Course Content
Introduction to JavaScript
Summary
You finished all the chapters! This is very wonderful! Let's now consolidate the information you learned during the course and take a quiz.
Literals, Variables, Constants
- Literal is a value in the code.
- Variable (
let
) is named storage of value (literal) for the multiple usages. - Constant (
const
) is an unchangeable variable.
Data Types
- number is a numeric data type.
- string is a text data type. Writing in quotes (
"
or'
). - boolean is a logical data type (
true
orfalse
). - array is a collection of values. The most usable methods is
push()
,pop()
,unshift()
andshift()
.
Basic operations
- Assignment (
=
). - Math (
+
,-
,*
, etc.). - Comparison (
>=
,<
,==
,===
, etc.). - Logical (AND
&&
, OR (||
). - String Concatenation (
+
between strings).
Conditional Statements
if (condition) {code block}
else {code block}
afterif
.else if (condition) {code block}
for a few conditions.
Loops
while (condition) {code block}
.do (code block) while (condition)
.for (let counter; condition; counter++) {code block}
.
Functions
function myFunc(arg1, arg2, arg3) {code block}
- Call the function:
myFunc(value1, value2, value3)
- Use the
return
keyword to return the value from a function.
1. Conditional Statements are used to:
2. Loops are used to:
3. Functions are used to:
Conditional Statements are used to:
Select a few correct answers
Loops are used to:
Select the correct answer
Functions are used to:
Select a few correct answers
Section 6.
Chapter 7