TheDeveloperBlog.com

Home | Contact Us

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

JavaScript Symbol isConcatSpreadable Property

JavaScript Symbol isConcatSpreadable 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.isConcatSpreadable Property

The JavaScript Symbol.isConcatSpreadable it is used to configure if an object should be flattened to its array elements.

NOTE: This property spreads the array to its elements when used for concatenation.

Syntax

Arrayname[symbol.isConcatSpredable] = false

Parameters

No parameters.

Return value

Concatenation Result.

Browser Support

Chrome 48
Safari Yes
Firefox 48
Opera Yes

Example 1

<script>
//JavaScript to illustrate Symbol.isConcatSpreadable
//creating array for the concatenation
var JavaTpoint = ['Core Java', 'RDBMS', 'C'];
var A = ['Python', 'R', 'C++'];
A[Symbol.isConcatSpreadable] = true;
var Show = JavaTpoint.concat(A);
document.write(Show);
//expected output:Core Java,RDBMS,C,Python,R,C++
</script>
Test it Now

Output:

Core Java, RDBMS, C, Python, R, C++

Example 2

<script>
//JavaScript to illustrate Symbol.isConcatSpreadable
//creating array for the concatenation
var JavaTpoint = [1, 2, 3];
var A = [6,7,8];
A[Symbol.isConcatSpreadable] = true;
var Show = JavaTpoint.concat(A);
document.write(Show);
//expected output:1,2,3,6,7,8
</script>
Test it Now

Output:

1,2,3,6,7,8

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