OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Why The Output is 4 Explain? [closed]

  • Thread starter Thread starter Sagar Soni
  • Start date Start date
S

Sagar Soni

Guest
I'm trying to get length. I expected 5 but I do not get what I expect. Can you explain in depth why it is not happening and reason of the result of 4?


Code:
let user1 = [342, 4344, 43];
let user2 = ("424", "100");
let join = user1.concat(user2);
document.writeln(join.length);

<p>I'm trying to get length. I expected 5 but I do not get what I expect. Can you explain in depth why it is not happening and reason of the result of 4?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let user1 = [342, 4344, 43];
let user2 = ("424", "100");
let join = user1.concat(user2);
document.writeln(join.length);</code></pre>
</div>
</div>
</p>
 

Latest posts

S
Replies
0
Views
1
Safwan Aipuram
S
Top