TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Javascript Object is() Method

Javascript Object is() Method with example on javascript, object, getOwnPropertySymbols(), getPrototypeOf(), defineProperties(), defineProperty(), entries(), freeze(), javascript tutorial, javascript array etc.

<< Back to JAVASCRIPT

JavaScript Object.is() Method

The Object.is() method of JavaScript is used to determine whether two values are the same value. There is a special built-in method that compares values.

Syntax:

Object.is(value1, value2);

Parameter

value1: The first value to compare.

value2: The second value to compare.

Return value:

This method returns a Boolean indicating whether or not the two arguments are the same value.

Browser Support:

Chrome 30
Edge Yes
Firefox 22
Opera Yes

Example 1

const object1 = {};
console.log(Object.is(object1));

Output:

false

Example 2

 const object1 = {
  property1: 56
};
console.log(Object.is(object1));

Object.seal(object1);
console.log(Object.isSealed(object1));

Output:

false
true

Example 3

const object1 = {};
console.log(Object.isExtensible(object1));
console.log(Object.is(object1));

Output:

 true
false

Next TopicJavaScript Objects




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf