Using a while loop. Print the numbers from 1 to 100, one on a line.
Using a while loop. Print the numbers from 1 to 100, one on a line.
Print the odd numbers between 1 and 100 inclusive.
Given this string below, split the string by the comma so that you have an array of 5 strings total, each being a letter.
var str = "A,B,C,D,E";
// fill in logicGiven an array of numbers, print each number. Change the values around to make sure it still works.
var numbers = [2, 4, 5, 6, 8];
// fill in logicGiven an array of numbers, print each number in it that is odd. Change the values around to make sure it still works.
var numbers = [2, 4, 5, 6, 8];
// fill in logicGiven an array of numbers, sum them, and then print out the sum. Change the values around to make sure it still works.
var numbers = [2, 4, 5, 6, 8];
// fill in logicGiven this function, call it to make it print "Hello world!".
function hello() {
console.log('Hello world!');
}
// fill in codeGiven this function, call it to make it print "Hello, Bob!".
function helloTo(name) {
console.log('Hello, ' + name + '!');
}
// fill in codeGiven this function, call it to make it return the result of 6 divided by 2. Store the result in a new variable called result.
function divide(a, b) {
return a / b;
}Write a function times2 that takes a number parameter num, and returns the result of multipling the number by 2. After you write the function, call the function like times2(5), and store the result in a new variable.