Javascript Tutorial For Beginners – #4 Javascript Arrays & Loops




This Javascript tutorial covers Javascript arrays and looping arrays in Javascript. Arrays store lists of items of any type. You can iterate a Javascript array with loops, making it easy to run actions on all of the items in the array.

This is a Free Javascript Course designed for beginners. These Javascript lessons cover the basics of Javascript and programming basics from the very beginning.

Original source


41 responses to “Javascript Tutorial For Beginners – #4 Javascript Arrays & Loops”

  1. Is this good usage of while loop? (it's for last FOR loop example)

    var myList = ['bananas', 'oranges', 'apples'];
    var i=0;
    while (i<myList.length) {
    alert("You have "+ myList[i] +" in your basket")
    i=i+1

  2. outputing text will be hard to get used to because i am used to the c++ syntax for out putting text on the screen, which has no + sign between the 2 strings… it is seperated by a cheveron as i like to call the operator "<<"

  3. Great videos

    Please see the 'homework' below: –

    //Functions are a piece of code that does one or more actions
    //Do not repeat yourself DRY

    function add(first, second){
    return first+second;
    }

    function subtract(first, second){
    return first-second;
    }

    function multiply(first,second){
    return first*second;
    }

    function divide(first, second){
    return first/second;
    }

    alert(add (9, 3));
    alert(subtract (9, 3));
    alert(multiply (9, 3));
    alert(divide (9, 3));

  4. I added the script tag into the HTML file but still got the same error
    "VM73:1 Uncaught ReferenceError: myList is not defined"
    I am using atom on windows 7.
    any help would be appreciated

  5. Thanks +LearnCode.academy I've been doing one of these lessons a day and I'm progressing incredibly! Your teaching videos are really helping me learn the basics of javascript. I even have some of my own scripts already!

  6. I understand left side is sublime and right side is chrome, but how do you connect them ? I guess that localhost:9000 does the magic. Thanks for the great instructions.

  7. Probably a stupid question but this my first video here. How are you inputting the code into the browser? Is it an IDE or are you typing it into the console? How is it connecting to the code and the browser

  8. bro ' i really like the way you teach , how many years of experience you have in javascript ? i want to be advanced like you , i just started to learn it weeks ago i created rock paper scissor game on my own … ! tell me .

Leave a Reply