Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by vineeth.mariserla
Page 8 of 8
What is the use of Object.isFrozen() method in JavaScript?
Object.isFrozen()Object.isFrozen() method is used to find whether an object is frozen or not. An object is frozen if it followed the below criteriaIt should not be extensible.Its properties should be non-configurable.It shouldn't accept any new properties.SyntaxObject.isFrozen(obj);Parameters - Object.isFrozen() accepts an object as a parameter and scrutinizes whether it is frozen or not and returns a boolean output.ExampleIn the following example Object.isFrozen() scrutinizes whether the object 'obj' is frozen or not. Since the object is not frozen, false will be displayed as the output. var object = { prop1 : 5 } var res = Object.isFrozen(object); ...
Read MorePush() vs unshift() in JavaScript?
push() vs unshift()The methods push() and unshift() are used to add an element in an array. But they have a slight variation. The method push() is used to add an element at the end of the array, whereas the method unshift() is used to add the element at the start of the array. Let's discuss them in detail.push()syntaxarray.push("element");ExampleIn the following example, to a 3 element array, using push() method another element is added at the back of the array and the result is displayed in the output. var companies = ["Spacex", "Hyperloop", "Solarcity"]; ...
Read More