We don’t have Access Modifiers in JavaScript, and all properties of an object are public, which means you can read and modify them outside the object. But what if you have a requirement to create private properties? Consider Product object as mentioned below, let Product = { id: ‘1’, price: 200, title: ‘Pencil’ } console.log(Product.id);ContinueContinue reading “How to create Private Properties in JavaScript.”
Tag Archives: Javascript
Video- How to use JavaScript array find method
https://youtu.be/DgROCYkg-lU This video explains How to use JavaScript array find method
Video – Scoping and Hoisting in JavaScript
This video explains Scoping and Hoisting in JavaScript
Video – JSON.stringify() in JavaScript
This video explain in detail about JSON.stringify in JavaScript.
Video – slice method in JavaScript
Explain Object.keys in JavaScript
Enumerating through the properties of a JavaScript object is a persistent requirement. Hence it becomes a popular question in a JavaScript interview. Any good JavaScript developer must know about various available options. Note: You can find a video tutorial on the same at the end of the article. To start with considering the Dog objectContinueContinue reading “Explain Object.keys in JavaScript”
Video – How to create constant or a read-only property in JavaScript
This video explains to create a constant or a read-only property in JavaScript. https://www.youtube.com/watch?v=d0D1C-z91lQ
Video- Why You need the apply() and the call() methods in JavaScript
To pass value of ‘this’ object in a function apply and the call methods are used. https://youtu.be/1nG3FKN3KjU The apply() and the call() methods are used to call a function indirectly. When you call a function using the apply() and the call() methods, that is called Indirect Invocation Pattern . The first parameter is alwaysContinueContinue reading “Video- Why You need the apply() and the call() methods in JavaScript”
Video – Various ways of creating a function in JavaScript
This video teaches you the various ways of creating a function in JavaScript. There are four ways a function can be created in JavaScript. They are as follows: 1. A function as a Statement 2. A function as an Expression 3. A function as an Arrow function 4. A function using Function constructor https://youtu.be/1koTc_lhZLUContinueContinue reading “Video – Various ways of creating a function in JavaScript”
Five Things about JavaScript delete operator
A better understanding of delete operator is necessary for JavaScript developers. As the name suggests, the delete operator deletes properties from the object. You can delete a property as shown below: It returns true on successful deletion. However, in some cases, it may return true even if it does not delete a property. In thisContinueContinue reading “Five Things about JavaScript delete operator”