Symbol.isConcatSpreadable JavaScript

The JavaScript Symbol.isConcatSpreadable property determines if an object should be flattened to its array elements or not. Syntax: Array_name[symbol.isConcatSpredable] = true/false Returns: Symbol corresponding to a specific key. Example 1: <!DOCTYPE html> <html> <body> <script> var alpha = [‘X’, ‘Y’, ‘Z’]; var beta = [‘A’, ‘B’, ‘C’]; beta[Symbol.isConcatSpreadable] = true; var Display = alpha.concat(beta); document.write(Display); … Read more