beyondMore pages

From “Learn All the JavaScript Basics in 20 Minutes” by Coding2GO Coding2GO

JavaScript basics in twenty minutes: variables to DOM

Core JavaScript basics, typed along in twenty minutes.

Open the interactive page →Make a page from any YouTube video

Key points

Terms the lesson explains

Look closer on screen

Value and data type

Logical operators

Questions to check yourself

What does the expression "5" + "5" give in the console?

55 — Quotation marks make both values strings, and adding two strings joins them into a longer text. 2:22

Why does the while loop in the counting example need count = count + 1?

It changes the value of count so the condition can eventually become false — If count never changes, count < 10 stays true and the loop runs forever. 7:35

What is the difference between console.log and return in a function?

console.log only shows a value, return gives the value back to the program — The video says console.log just shows something, while return gives a value back so the program can keep working with it. 11:56

Which index holds the first item of an array?

0 — In JavaScript array positions start at zero, so the first item is at index 0. 12:39