JavaScript prototype chain | Simple
In JavaScript, every object has a prototype, including the prototype object. This “chain” goes all the way back until it reaches an object that has… Read More »JavaScript prototype chain | Simple
In JavaScript, every object has a prototype, including the prototype object. This “chain” goes all the way back until it reaches an object that has… Read More »JavaScript prototype chain | Simple
Use the JavaScript sort() method with the reverse() method in the Array object to get sort elements in descending. This method sorts the elements of… Read More »JavaScript sort descending | Example code
Use Use instanceof for custom types and use typeof for simple and complex built-in types, this is the main difference between typeof and instanceof in… Read More »What is the difference between typeof and instanceof?
Use And (&&) or OR (||) statement to get the if statement with multiple conditions in JavaScript. Just make sure you wrap your conditions in… Read More »JavaScript if statement multiple conditions | Example code
JavaScript if Conditional statements are used to decide the flow of execution based on conditions. If a condition is true, you can perform one action… Read More »How to write an if statement in JavaScript if i=5 | Example code
Using JavaScript if else statement you can make a decision-maker program. The if statement executes a statement if a specified condition is truthy. If the… Read More »JavaScript if else statement | Basic code
Use includes() method to inarray check value in Javascript. This method for arrays specifically solves the problem, and so is now the preferred method. This… Read More »JavaScript inarray check | Example code
Use the if else if statement if you want to check 2 conditions in JavaScript. Use if to specify a block of code to be… Read More »if else if JavaScript | Basic code
Use JavaScript in the operator to check if the object has the key. Use myObj.hasOwnProperty(‘key’) to check an object’s own keys and will only return… Read More »JavaScript checks if the object has key | Example code
JavaScript new object means you can create an object, use the new keyword with Object() constructor, like this: And add properties to this object, we… Read More »JavaScript new object | Basic code