The typeof operator returns a string indicating the type of the unevaluated operand.(source: MDN) Numbers 2.String 3. Booleans 4.Object 5. Function 6.undefined 7.Symbol Remember I referred here for writing this article. Follow Javascript Jeep🚙 for more interesting Javascript tips.
Tag Archives: Javascript tips
Javascript Tips : 1 → Using Closure functionality to create a function that sets the style to…
The styleSetter function will return a function that has a local reference to the element that we have passed to styleSetter function so this is stored in the scope of the function which is returned by the function styleSetter . Follow Javascript Jeep🚙 🥶.
Find the number of days between two dates in Javascript
Learn to find the difference between two dates in javascript. Let’s take an example of what we are going to do. We have a function that takes two dates as the input, and it returns the number of days. If we pass May 22, 2019 and May 28, 2019, then it returns 7. The solution …
Continue reading “Find the number of days between two dates in Javascript”
Understand filter in javascript.
Javascript filter method. filter() is used to filter the array and creates a new array with the elements which satisfy the condition provided as predicate function . filter method takes a predicate( predicate is commonly understood to be a Boolean-valued function P: X→ {true, false}) as argument , to test each element of the array satisfy condition …
Get keys of the object in javascript
Object.keys() method can be used to get the keys of the object. We get the keys in same order as we get in the normal for..in loop It returns an array filled with the keys of the object. // array var num = [1 , 2, 3];console.log(Object.keys(num)); // [‘0’, ‘1’, ‘2’] // objectvar obj = …