TheDeveloperBlog.com

Home | Contact Us

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

JavaScript Symbol hasInstance Property

JavaScript Symbol hasInstance Property with examples on javascript symbol methods, javascript symbol property, javascript tutorial, hasInstance, isConcatSpreadable, match, prototype, search, for(), keyFor(), toString(), unscopables, toPrimitive, split etc.

<< Back to JAVASCRIPT

JavaScript Symbol.hasInstance Property

The JavaScript Symbol.hasInstance is used to determine if a constructor object recognizes an object as its instance.

Syntax

[Symbol.hasInstance] (obj)

Parameters

An object as one of the constructor.

Return value

Return true if the value is in the chain of an object, otherwise false.

Browser Support

Chrome 5.1
Safari Yes
Firefox 50
Opera Yes

Example 1

<script>
//JavaScript to illustrate Symbol.hasInstance
var JavaTpoint = [12,45];
document.write( Array[ Symbol.hasInstance ](JavaTpoint) );
//expected output:true
</script>
Test it Now

Output:

true

Example 2

<script>
//JavaScript to illustrate Symbol.hasInstance
//Using user define function
function JavaTpoint()
{}
var Script = new JavaTpoint 
document.write( JavaTpoint[ Symbol.hasInstance ](Script) );
//expected output:true
</script>
Test it Now

Output:

true.

Next TopicJavaScript Symbol




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