JavaScript Operators and Loops

Like many other programming languages, JavaScript uses operators and loops to iterate, assign, concat and solve mathematical problems is need be. JavaScript uses all the operators found in Maths and also uses these operators on things like strings. Operators come in a variety of form. Today I will speak of Comparison operators and Assignment operators. Comparison operators are used to compare things, and Assignment operators are used to assign value to things.

What of Loops

Like many other subjects in JavaScript, each hold an intricate nature with a far more information on each word. There are two types of simple loops which are For Loops and While Loops. For loops take a variable which is created within it, and then compares the variable to something and if the condition is met. The for loop is run. A while loop is more simpler than a for loop. A while loop will take a conditionals and run while true.

                    
    //Creating an A.I. robot
    for (let x = 0; x <= 19; x++) {
        if(moneyGiven >= changeGiven) {
            return "Error, incorrect change";
        } else {
            return "Have a night day"
        }
    }

    //A basic while loop
    while (x < acr.length(acr.length - 1)) {
        ban.push(x)
        x++
    }