Learn to Code via Tutorials on Repl.it!

← Back to all posts
Javascript Advanced Concepts Explanation

WARNING: Commenting will automatically update you once I updated.

Welcome to JACE!
Here youll learn everything you need to know about Javascript. Lets get started!


JavaScript statements are composed of:

Values, Operators, Expressions, Keywords, and Comments.

This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":

Most JavaScript programs contain many JavaScript statements.

The statements are executed, one by one, in the same order as they are written.

Semicolons ;

Semicolons separate JavaScript statements.
Add a semicolon at the end of each executable statement:

When separated by semicolons, multiple statements on one line are allowed:

Conditional Statements


Very often when you write code, you want to perform different actions for different decisions.

You can use conditional statements in your code to do this.

In JavaScript we have the following conditional statements:

  1. Use if to specify a block of code to be executed, if a specified condition is true
  2. Use else to specify a block of code to be executed, if the same condition is false
  3. Use else if to specify a new condition to test, if the first condition is false
  4. Use switch to specify many alternative blocks of code to be executed

JavaScript Comparison and Logical Operators

Comparison and Logical operators are used to test for true or false.

Comparison Operators

Comparison operators are used in logical statements to determine equality or difference between variables or values.

Given that x = 5, the table below explains the comparison operators:

==equal toox == 8
===equal value and equal typex === 5
!=not equalx != 8
!==not equal value or not equal typex !== 5
>greater thanx > 8
<less thanx < 8
>=greater than or equal tox >= 8
<=less than or equal tox <= 8

How Can it be Used

Comparison operators can be used in conditional statements to compare values and take action depending on the result:

Logical Operators

Logical operators are used to determine the logic between variables or values.

Conditional (Ternary) Operator

JavaScript also contains a conditional operator that assigns a value to a variable based on some condition.



for/in Statement


Loop through the properties of an object:

Definition and Usage

The for/in statement loops through the properties of an object.
The block of code inside the loop will be executed once for each property.

JavaScript supports different kinds of loops:
for - loops through a block of code a number of times
for/in - loops through the properties of an object
for/of - loops through the values of an iterable object
while - loops through a block of code while a specified condition is true
do/while - loops through a block of code once, and then repeats the loop while a specified condition is true

Note: Do not use the for/in statement to loop through arrays where index order is important. Use the for statement instead.


Thanks for reading! Adding more stuff soon!


Added for/in Statement [Section]


Well um this isn't thaat advanced...perhaps add functions, loops, etc.?


i am currently, working on pyyoutube and other stuff..



@Bookie0 pyyoutube = download videos & get video stats