Leetcode Js
Leetcode Js
let countNum = 1;
return countNum++
}
console.log(counterIncrease());
console.log(counterIncrease());
console.log(counterIncrease());
console.log(counterIncrease());
=============================================================================
check the value of the object if the is same so return true otherwise false.
let val = {
name:"farjaad",
age: 27
}
return true
}
else {
return false
}
valCheck(["farjaad", 27])
console.log(valCheck, "true")
correct version
let val = {
name: "farjaad",
age: 27
};
===================================================================================
=======
Write a function createCounter. It should accept an initial integer init. It should
return an object with three functions.
let initNum = 1
console.log(counter.increment()); // Output: 1
console.log(createCounter().increment()); // Output: 1