Array-1

 

In this example, We will see how to declare arrays in javaScript. var vehicles= ["Alto", "Swift", "BMW"]; See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p id="sample"></p> <script> var vehicles= ["Alto", "Swift", "BMW"]; document.getElementById("sample").innerHTML = vehicles; </script> </body> </html>
Output