JavaScript concatenates all the elements in an array into a string

From , 4 Years ago, written in JavaScript, viewed 54 times.
URL https://pastebin.vip/view/bf40d1cb
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p id="demo">Click the button to join the array elements into a string.</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. <script>
  10. function myFunction()
  11. {
  12. var fruits = ["Banana", "Orange", "Apple", "Mango"];
  13. var x=document.getElementById("demo");
  14. x.innerHTML=fruits.join();
  15. }
  16. </script>
  17.  
  18. </body>
  19. </html>
  20. //javascript/7862

Reply to "JavaScript concatenates all the elements in an array into a string"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website