Sign in

gestalt
image from google

Design and art, there is a lot of discussions going on with these two topics but to make things clear in short

yet art is always an integral part of the design, though art doesn't talk about problem-solving whereas design is all about problem-solving and function

Good and Bad Design


let obj_1 = { name : "xyz" }
let obj_2 =obj_1 ;

function print(num){ if (num <= 0){  // this is the base case 
return 0
}

console.log(num)
print(--num) // this step is recurrsion }print(4)/*output4
3
2
1
*/

function outer(){

const a = 10;

function inner(){

const b = 10;

console.log(a+b);

}

inner()

}
outer()/*OUTPUT : 20*/
function outer(){

var a = 0;

return function(){

console.log(++a)

}

}

let obj = {
firstname : "f_name",
lastname : "l_name"
}
var first_name = obj.firstname;
var last_name = obj.lastname
console.log(first_name)
console.log(last_name)
let obj = {
firstname : "f_name",
lastname : "l_name"
}
let { firstname:first_name , lastname:last_name}…

var arr = [ "one" , "two" , "three" ]/* if we need to access the array elements with variables then we need to initialise them with variables  */var a = arr[0];
var b = arr[1];
var c = arr[2];

— Bind Method returns a new Function —

let _obj ={
first_name:"xyz",
last_name:"zyx"
}
function print(){
console.log(`firstName : ${this.first_name} lastName : ${this.last_name}`)
}
let new_function = print.bind(_obj)new_function();
let _obj ={
first_name:"xyz",
last_name:"zyx"
}
function print(title){
console.log(`${title} . firstName : ${this.first_name} lastName : ${this.last_name}`)
}
let new_function = print.bind(_obj,"Mr")new_function();

const obj1={
f_name : "xyz",
l_name : "zyx",
print : function(title){
console.log(` ${title} . first Name : ${ this.f_name } ,
last Name : ${this.l_name} `)
}
}
obj1.print("Mr"); // this method of passing arguments is know
const obj2={
f_name : "efg",
l_name : "gfe",
}
obj1.print.apply(obj2,["Mr"])

const obj1={        f_name : "xyz",
l_name : "zyx",
print : function(){
console.log(`first Name : ${ this.f_name } ,
last Name : ${this.l_name} `)
}
}obj1.print();const obj2={
f_name : "efg",
l_name : "gfe",
}
const obj2={
f_name : "efg",
l_name : "gfe",
}
obj1.print.call(obj2) /* by using call() we…

Ashwings

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store