In this video, I will show you what if we add two arrays with binary + operator in JavaScript.
Arrays have their own implementation of the toString method that returns a comma-separated list of elements.
JavaScript's + operator has two purposes: adding two numbers, or joining two strings. It doesn't have a specific behavior for arrays, when you try to add two arrays with binary + operator it converts both the arrays into strings and the final output will be a string as well.
5 авг 2024