Learn to Code via Tutorials on Repl.it!

← Back to all posts
🎇JavaScript Crash Course 🎇 [1000 Lines]
OldWizard209 (1357)

JavaScript Tutorial

Welcome to this complete JavaScript tutorial, enough to get you kickstarted into learning the complete JavaScript language.

Course Content:

  • What is JavaScript?
  • Where does JavaScript code run?
  • Running JavaScript code on Google.
  • Running JavaScript code on an editor.
  • Installing Node.JS
  • Actual coding:
    • Comments.
    • Variables.
      • What are variables?
      • Variables in JavaScript
      • Strings.
        • Escaping string literals
    • Arithmetic Operations
      • Addition
      • Subtraction
      • Division
      • Multiplication
      • Remainder
      • Incrementing
      • Floats
      • Augmented Operations
    • String Manipulation
      • Using single quotes
      • Escape Sequences
      • String Manipulation
      • Finding items in a string.
    • Exercise 1
    • User Input
    • Converting Data types.
    • Arrays
      • Single Arrays
        • Accessing Array Data
      • Nested Arrays.
        • Acessing Nested Array Data
      • List manipulation.
        • .push()
        • .shift()
        • .unshift()
        • .pop()
    • Object literals
      • Accessing Object Data
    • Functions
      • Parameters and Arguments.
      • Global vs Local
    • Boolean values.
    • typeof to get data type.
    • If statements.
      • If statements' operators.
      • and and or
      • Else statements
      • Else if statements
    • While loops.
    • Switch Statements

What is JavaScript?

JavaScript (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions. JS, was introduced by Brendan Eich in 1995, and since has grown to be one of the most popular programming languages for large companies like FAANG(Big Tech) on an average salary of $70,000 in the U.S. With JS, you can become either a Front-End-Developer, a Backend-Developer, and even a Full-Stack-Developer. 97% of the websites uses JS to interact with their pages. YEAH let that sink in .

So, why not start learning it already when it is extremely easy to use and write the language?


Where does JavaScript code run?

JavaScript was initially designed to only run on browsers. On Mozilla, the JS Engine was called SpyderMonkey and on Google, it was called V8. Up until 2009, this was the case, when an extremely clever engineer called Ryan Dhal took the open-source JS Engine in Chrome and embedded it into a C++ program. He called it Node. Soo, basically, Node is a C++ program that allows us to run JS outside of Google.

Hope, I haven't bored you yet. DW, the interesting part is starting lol.

Running JavaScript code on Google

Now, I am going to show you how we can run JS on Google, like I said, using the JS Engine inside Chrome. So..

  • Go to Chrome and right-click the main screen.
  • Hit inspect
  • Go to the console tab.

I assume everyone knows how to do this so I will not add pictures.

To test if your console is working, type in console.log('Hello, World!');. This is a little "Hello, World!" program in JS. Use it to test the console. You should see an output displaying: Hello, World! right under your line of code.

Note: It doesn't matter if you put the semi-colon or not, but it is best practice to put one.

Running JavaScript code on an editor

Now you can't just use google to run all your JS, beacause there is no way to properly save the code you write. For actual code compiling, debugging and plugins, we need a Code-Editor. There are amazing editors out there that you can download. Or you can just use the amazing Replit IDE you are already on. Nevertheless, here are a few editors you can download:

Installing Node.JS

I would also recommend downloading Node as it is very useful and comes in handy when downloading "third-party-libraries" which are very helpful when developing apps and games using JS. For this tutorial though, I will be using Replit as it is the fastest, easiest and the best way to write Code efficently and quickly. So, if you haven't already, go make a Node.js Repl on your replit. Or click here to make one.

NOW!!! Let's get started with actually JavaScript learning and forget the boring stuff.

Actual Coding:

Lets get started with learning JS:


Comments.

I just wanted to add a little note about comments in JS. Comments in programming generally are a bunch of lines that are there to add context to code. They are not interpreted as code, rather they are ignored and are just there so that other programmars can see those comments and understand what is happening in the code. Comments in JavaScript are defined using two slashes, //. Here is an example:

// This is a comment and will not be interpreted as code.
console.log("The comment is not code. YAYYY!!!");

Variables

What are variables?

Variables, the most important concept in JS and in any programming language, are used to store data temporarily in the computer's memory. So variable is we storing our data somewhere and allocating it with a name. With this, we can read the data at the given location using the variable name later on and modify it the way we want. Think of variables like algebra. We assign a value to a variable like: x = 5. In this case, x is the variable. Here is a little metaphor to understand variables.:

Let's say we have a few boxes. Each box contains things like stationery, books, devices, etc. Then to remember what box contains what, we put a label on each of the boxes, with keywords. "Stationery", "Books" "Devices". This way, we remember what thing is in what container. Variables are the same exact thing, but in programming. In programming, the variables' name would be the labels, the value in the variable would be the box contents, and the memory allocated into the computer, would be the box itself.


Variables in JavaScript.

Up until the release of ES6, the standardized version of JavaScript, the practice of defining a variable in JavaScript was using the var keyword. But after its official release, defining a variable is best using let. There is a slight difference between these two keywords. The difference is the scope of the variable. The var keyowrd provides a global scope, meaning that it can be used in the entire function block. Where is let, is used in the enclosing function block, meaning it can only be used in the function itself. For more info on this, read this SO page that explicitly explains the differences between these two ways of defining variables.

Now, after we have written let, we can give a name or an identifier to our variable. This is the variable name. We can call it whatever we want as long as it meets the rules of defining a variable. There are a few ways you can define a variable. Here are the common conventions:

// Using only the variable name without any space.
let name;

// Using two words separated by an underscore.
let my_name;

// Using two words using camelCase(First letter capital of each word except first.)
let myName;

// Using a word and a number without any space.
let name1

And these are rules that should be followed:

// Cannot be a reserved keyword. These are keywords that are in JS like, let, var, if, etc.
// Should be meaningful, not just letters like a, b, x, etc.
// Cannot start with a number.
// Cannot contain space.

Now, if we use console.log(name); to actually print out the value associated with the name variable, we will see in the output, that it is undefined:

undefined

This is because there is no value given to the variable. To actually give a value to a variable, we have to use an = sign:

// Giving the variable a value
let name = "John";
console.log(name);

Now, because the variable name is set to a string, "John", the name's value is John. So when we print out the value of name, we will get the output as John:

John

BTW, the "John", the value set to name is called a string. A string is a sequence of characters. You can set it to anything you like and it will be printed out. A string can be either double quote, "<string>" or single quote, '<string>' . It evaluates as the same thing.


Arithmetic Operations.

There are four main operations we learned in math:

  • addition : +
  • subtraction : -
  • multiplication : ×
  • division : ÷

These are the normal symbols we use. But in programming, there is a slight difference. Division and Multiplication symbols are differenct and there are a few more operations. Here are the examples with the outputs:

  • Addition:

    • let addition = 3+2;
      console.log(addition);
      Output:5
  • Subtraction:

    • let subtraction = 3-2;
      console.log(subtraction);
      Output: 1
  • Multiplication:

    • The symbol for multiplication in JS is *
    • let multiplication = 3*2;
      console.log(multiplication);
      Output: 6
  • Division:

    • The symbol for division in JS is /
    • let division = 4/2;
      console.log(division);
      Output: 2
  • Finding only the remainder of a an improper division:

    • We can find only the remainder of a division using the % symbol
    • let remainder = 3%2;
      console.log(remainder);
      Output: 1 .
      Because, ³⁄₂ = 1 ½, so 1 is the remainder
  • Floats:

    • Floats are literally decimal numbers in JavaScript. They can also be referred to as doubles.
    • let myFloat = 7.89;
  • Incrementing.

    • You can add to variables using ++ or by simply using a number.
    • let myNumber = 7;
      // Incrementing.
      console.log(myNumber + 3);
      Output: 10 .
  • Augmented Operations.

    • Augmented Operations is basically using operations on variables defined to numbers.
    • let a = 5;
      let b = 7;
      let c = 3;
      
      // Augmentation
      a = b + c
      b = a - c
      c = a * b
      
      console.log(a);
      console.log(b);
      console.log(c);
      Output:
      10
      7
      70

String Manipulation

Using single quotes.

When using a type of quote in a string, the quotes you use outside would be the opposite as not to confuse the IDE. Or you can use a backslash \ to prevent this. Here are quick examples:

// Using
let myString = 'This is my string using "double-quotes" and JavaScript does not get confused!!!';

let myString = "This is another string using \"backslashes\" and JavaScript does not get confused!!!"

Escape Sequences.

Escape Sequences are used to manipulate a string using a backslash and a letter. There are 6 main escape sequences(other than the ones i already told you).

  • \n Creates a newline:

    • console.log("Hello\nJohn")
      Output:
      Hello
      John
  • \r Creates a Carriage return. Replaces the characters after the sequence with the ones behind the sequence.

    • console.log("  llo\rHe")
      Output: Hello
  • \t Creates a TAB.

    • console.log("Hello...\tBYE")
      Output: Hello... BYE
  • \b Erases the previous character and replaces with the character after the sequence.

    • console.log("Helli\bo")
      Output: Hello
  • \f Forms a feed, i.e A \n with a \t

    • console.log("Greetings\fHello")
      Output:
      Greetings
                Hello
  • Concatenating a string.

    • You can add two strings using a + operator.
    • console.log("Hello, " + 'John')
      Output: Hello, John
  • Concatenating a string using +=.

    • You can add two strings also using a += on another line. You can also do this with variables.
    • var ourStr = 'Hello, ';
      ourStr += 'John';
      
      console.log(ourStr)
      
      // adding variables
      var introduction = "My name is, ";
      var firstName = 'John ';
      var secondName = 'Smith';
      
      console.log(introduction + firstName + secondName);

      Output: Hello, John


Finding items in a string.

JavaScript allows us to find things in a string, for example the length of the string, the nth character, the last character etc.

  • Finding the length of a string.

    • We can find the length of a string using .length in JS. It will return the number of characters in the string, including spaces if there are any.

    • var name = 'John';
      
      console.log(name.length);

      Output: 4

  • Bracket notation.

    • Bracket notation can be used to find the index of a character in a string. The brackets we use are squre: [] and the first index starts with the number 0.
    • var name = 'John';
      
      // This will return the character at index 0, which is the first character, 'J'
      console.log(name[0]);
      // This will return the character at index 0, which is the second character, 'o'
      console.log(name[1])

Exercise 1

This is an exercise for you. Here is the prompt:

Write a program that is going to use augmented operations to write a BODMAS (Brackets, Orders, Division, Multiplication, Addition, Subtraction.) to print an answer of 9. Use the numbers 3, 6, 2, 8, and 4 only. Use variables from 'a' to 'e' for each of the number. Then use the variable calculation to do the math using the varaibles. Next, print out the following sentence in the exact fomat using string concatenation and escape sequences.

I used the numbers with "BODMAS" to find the answer of 9. 
The numbers used were:
3, 8, 6, 2, 4

Note: Use only string concatenation.


Solution, Exercise 1.

Code:

let a = 3;
let b = 2;
let c = 6;
let d = 8;
let e = 4;

var calculation = ((a * c + d) / b) - e;

console.log("I used the numbers with \"BODMAS\" to find the answer of " + calculation + ".\nThe numbers used were:\n" + a + ', ' + b + ', '+ c + ', ' + d + ', ' + e)

Hope you got it.


User Input.

We can get user input in JavaScript using the prompt function, which is defined to a variable name. The prompt asks the user to input something. We can use that input to print out fancy things.

var userName = prompt("Enter your name ")

console.log("Hello, " + userName + ". Welcome to JavaScript.")

So if we input John, we will get, Hello, John. Welcome to JavaScript..


Converting data types.

We can change an integer to a string and vice versa in JS. We can do that using the parseInt and toString methods. To do that, we can define a varibale, and use these functions to convert them into a different datatype.

// Change string to integer:
var num = 9;
var n = num.toString();
console.log(n)

// Change integer to string:
var num = '9';
var n = parseInt(num);
console.log(n)

Arrays

Single Arrays

Arrays in JS are basically lists, that can contain items and can be modified. The syntax of writing an array is using a set of square brackets [], and inside, the items separated by commas. Lets define an array:

// Array containing John's first name and his age.
var myArray = ["John",  21];

Accessing Array Data

We can access array data using the same way we access data and characters in a string. We can use the index of the list, once again, starting from 0.

var myArray = ["John",  21]

console.log(myArray[0]) // -> John
console.log(myArray[1]) // -> 21

Nested Arrays.

Nested Arrays, or Multi-Dimensional Arrays in JavaScript and in any other programming language, are a bunch of lists contained inside another list. The arrays in the larger array are treated as single elements and are separated by commas. Here is an example:

// Nested list of my favorite movies/shows (not IRL lol) with their directors.
var myFavMovies = [["Alex Rider", "Andreas Prochaska"], ["Avengers: Endgame", "Russo Brothers"], ["The Matrix", "The Wachowskis"]]

Accessing Nested Array Data

Accessing data in Multi-Dimensional Arrays is the same as accessing elements in normal arrays, except first we need to refer the index of the list in the array, and then the elements in the list. Here is an example:

var myFavMovies = [["Alex Rider", "Andreas Prochaska"], ["Avengers: Endgame", "Russo Brothers"], ["The Matrix", "The Wachowskis"]]

console.log(myFavMovies[1]) // Returns Second list in myFavMovies array.
console.log(myFavMovies[1][0]) // Returns Second list in myFavMovies array and then the first element in it.

This is helpful if we want to print out information from the lists into a nice statement like:

var myFavMovies = [["Alex Rider", "Andreas Prochaska"], ["Avengers: Endgame", "Russo Brothers"], ["The Matrix", "The Wachowskis"]]

// We can use this feature to print a statement:
console.log("\nOne of my favorite movies is " + myFavMovies[1][0] + ", directed by " + myFavMovies[1][1] + ".")

Output: One of my favorite movies is Avengers: Endgame, directed by Russo Brothers.

List manipulation.

  • .push()

    • We can add elements into an array in JavaScript using the .push() function. The push() function will ad an element to the end of an array. We know it is a function because of the parentheses in the end.

    • let users = ['John', 'Ann', 'Mark'];
      // New user
      let newUser = 'Martin';
      
      users.push(newUser)
      console.log(users)
      // "users" will now be ['John', 'Ann', 'Mark', 'Martin' ]
  • .unshift()

    • .unshift() is the same as .push() but, .unshift() adds elements to the start of the list.

    • let users = ['John', 'Ann', 'Mark'];
      // New user
      let newUser = 'Martin';
      
      users.unshift(newUser)
      console.log(users)
      // "users" will now be ['Martin', 'John', 'Ann', 'Mark']
  • .pop()

    • We can remove only the last element in an array using the .pop(). This will then return the same array without the lat element, so then the new array's last element will be the second last of the initial list.

    • let users = ['John', 'Ann', 'Mark'];
      // New user
      users.pop()
      
      console.log(users)
      // "users" will now be ['John', 'Ann' ]
  • .shift()

    • .shift() is the same as .pop() but it is the opposite. .shift() removes the first element from the array, not the last.

    • let users = ['John', 'Ann', 'Mark'];
      // New user
      users.shift()
      
      console.log(users)
      // "users" will now be ['Ann', 'Mark' ]

Object Literals

Objects in real life are literally things that have propetrties, like a bag is an object, it's color is its property. The same way, objects in JavaScript are the same, but we use key:value pairs to define them. The value is defined to the key using a colon. This is an example of an object in JavaScript.

let replitInfo = {
    yearFounded : '2016',
    placeFounded : 'San Francisco',

    funds : {
        funder1 : 'Andreessen Horowitz',
        funder2 : 'Y Combinator',
        funder3 : 'Bloomberg Beta'
    },

    founders : {
        ceo : 'Amjad Masad',
        coFounder1 : 'Faris Masad',
        coFounder2 : 'Haya Odeh'
    }
}

As you can see, you can have multiple objects in an object. And all new objects are separated by commas.

Accessing Object Data.

We can access data in Objects using a . after the name of the object and referring to the key name, which would give us the value. So to access the place where replit was founded, the placeFounded key, we do this:

// Get a place where replit was founded
console.log(replitInfo.placeFounded)

This will return the value for placeFounded, which would give us San Francisco.

To access the data inside another object in the object, we will use the . to access the object, and then another . to access the keys inside that object.

// Get name of a funder.
console.log(replitInfo.funds.funder1)

So first we will access the funds object and then inside we will access fund1.


Functions

Functions are used to "encapsulate" a few lines of code that are meant to accomplish a specific task. Once a function is written, it can be used over and over and over again. Functions can be "called" from the inside of other functions. The syntax of defining a function is using a pair of brackets after the function name which comes after the keyword function and all the code that has to be executed in a pair of curly brackets.

function myFunction(){
    console.log("Hello, World");
}

Now if you run the program, nothing happens and that is because the function gets allocated into the computer's memory, but doesn't get called, and thus nothing happens. To actually interpret the code in the function, we need to call it.

// Create function
function myFunction(){
    console.log("Hello, World");
}

// Call functions
myFunction();

Parameters and Arguments.

Arguments are values that can be input into the function that can be given when calling the function. Parameters are the values that is given by the arguments. Confusing? Let me explain practically.

function myAddition(a, b) { // a and b in the parentheses are the parameters.
    console.log(a - b)
}
// Now, we are going to pass in the arguments 
myAddition(10, 5)

// 10 is equals to a, and b is equals to 5. Up in the function, we did a - b, so we are basically doing 10 - 5.

Returning a value from a function.

A return statement simply returns a statement. Instead of console.log(), we can just use return. Although, console.log() is a function used to print information to the console. return on the other hand is a call to pass some value back up to where the call was made. Here is an example:

function myAddition(a, b) { 
    return 'Two numbers are ' + b + " and " + a + "."
}

myAddition(10, 5)

Global vs Local.

Global scope is when a variable is defined outside a function. This variable can now be used anywhere in the whole code, in any function. For example this code has a variable defined outside the printNumber function. So, it can be used in any function:

var number = 6;

function printNumber() {
    console.log(number)
}

printNumber()

Local scope is when a variable defined in a function can only be used in the same function block, and will not work in other functions.

function defineNumber() {
    var number = 6;
}

function printNumber() {
    console.log(number)
}

printNumber()

But here, we get an error : number is not defined, which is because the scope of the variable number, is only limited to the function printNumber .


Boolean values.

Boolean values are simple values that evaluate to true, or false. They are basically like on and off switches, were on means true, off means false. All numbers return true, except 0 which return false.

// Returns False
function myFalseFunc() {
    return false;
}

// Returns True
function myTrueFunc() {
    return true;
}

Getting to know the data type.

We can know the data type of a variable using the typeof.

var aNumber = 9;
var aString = "Hello"
var booleanValue = false;

console.log(typeof aNumber);
console.log(typeof aString);
console.log(typeof booleanValue);

Output:

number
string
boolean

If statements.

If statements are basically conditionals, they are used to make decisions. If statements are english like and do something, if something is what we have set it to be. Here is how we would define an if statement. The == operator compares the value or equality of two objects.

var number = 5;
// Literally means, if the number variable is true, do whatever is in the brackets.
if (number) {
    console.log("Number")
}

If statements' operators.

Operators in if statements consists of ==, >, >=, <, <=. These are just like math inequalities. Here is an example:

var number = 5;
var number2 = 7;
var trueValue = true;

// If number is equals to 5.
if (number == 5) {
    console.log("Number is 5")
}
// Prints out "Number is 5" because number is set to 5.


// If number 2 is greater then 10:
if (number2 > 10) {
    console.log("Number is greater than 10")
}
// Prints out nothing because number2 is set to 7, which is smaller than 10.


if (number2 <= 10) {
    console.log("Number is smaller than or equals to 10")
}
// Prints out "Number is smaller than or equals to 10" because number2 is set to 7, which is smaller than 10.

// Will execute the code in brackets if value is true.
if (trueValue) {
    console.log("True Value")
}

Note: If we don't put any operator, then it is going to check the boolean value of the value and execute code if it is true.

Else statements.

Else statements do something if the previous conditionals do not meet the requirement.

var age = 12;

if (age >= 18) {
    console.log("You meet the consent age.")
}

else {
    console.log("Nope, you are too old.")
}

"Nope, you are too old." will be printed out because age is less then 18 and all other ages under 18 will be ignored.

The && and ||.

&& means and and || means or. && compares all values and if they are true, the code will run. The ||, will run if either of the given conditions evaluate to true.

// "&&" example
let number = 32;

if (number > 20 && number < 40) {
    console.log("Number is smaller than 40 and greater than 20")
}   
// || example
let number = 32;
 
if (number == 25 || number < 40) {
    console.log("Number is smaller than 40 or equals to 25")
}  

Else If Statements.

Else if statements are executed after the initial if statement.

let number = 11;


if (number == 9) {
    console.log("Number is 9")
}   

else if (number == 11) {
    console.log("Number is 11")
}

While loops.

A while loop will run as long as some conditional is true. While loops are english like. "While something is true, run this code."

let num = 0;

while (num < 5) {
    console.log("Number is smaller than 5")
}

But this will run forever an never stop. To stop the program once it has done what we want, we use a break statement.

let num = 0;
// Will print "Number is smaller than 5" only one time.
while (num < 5) {
    console.log("Number is smaller than 5")
    break;
}

Switch Statements

Switch statement are used to perform different actions in different conditions. They are basically used to avoid repetition of if statements. Here is the syntax of writing a switch statement, which is usually embedded in a function.

function switchStatement(expression) {
    switch(expression) {
    case x:
        // runs this code block if expression equals to "x".
        break;
    case y:
        // runs this code block if expression equals to "y".
        break;
    default:
        // runs this code block if expression is not equals to any of the above cases.
    }
}

Lets make a switch statement that relies on user_input to print out the name of the day, relative to the number. Try it out yourself first. Here is my solution:

var user_input = parseInt(prompt('Enter day number '));

function getDay(expression) {    
    switch(expression) {
        case 1:
            console.log('Monday')
            break;
        case 2:
            console.log('Tuesday')      
            break;
        case 3:
            console.log('Wednesday')      
            break;
        case 4:
            console.log('Thursday')      
            break;
        case 5:
            console.log('Friday')      
            break;
        case 6:
            console.log('Saturday')      
            break;
        case 7:
            console.log('Sunday')      
            break;
        default:
            console.log("No day on this number.")
    }
}

getDay(user_input)

Output:

Enter day number > 7
Sunday

I used parseInt to convert the user input into an integer because it is initially a string.


Conclusion:

I hope this course is enough to build your foundations on JavaScript and its syntax. There are many courses on YouTube that build more knowledge on these topics. Here are a few on Youtube:

Credits:

Credits to @OldWizard209 and @0ldWizard209 's brain for contributing to 100% in making the tutorial. Also thanks to @Th3Coder for picking out spelling mistakes and asking me to add a few more touches.

And also, there are tons of mistakes in grammar and spelling. So if you find any, tell me and I will fix it 🤙🤙🤙
Comments
hotnewtop
Bookie0 (6183)

Really cool!

JavaScript (often shortened to JS)

Lol when I read this sentence, it reminded me of how some people incorrectly think that Java is short for Javascript xD

Also, you could add that you can use multi-line comments (/* */) instead of individually commenting out each line with (//):

/* Hi
Wow
Loads of lines

Pog 
*/

And I saw someone suggested adding for loops; why don't you add them? You could add them in a Loops section with the while loops. :)

Anyways, great tutorial! :D

OldWizard209 (1357)

yeah.

Lol when I read this sentence, it reminded me of how some people incorrectly think that Java is short for Javascript xD

So true. I have also seen many people confuse java with javascript. Mainly because they are both popular, and were released in a one-year gap.

About the comments, yeah I didn't talk about multiline comments. Imma add it dw.

I will add for loops soon. Blame school. @Bookie0

and lastly, THANKS.

@Bookie0

Bookie0 (6183)

@OldWizard209 Lmao alright.
No problem! :)

codingjlu (102)

Thanks for all the hard work you put into this. Updoot :)

OldWizard209 (1357)

thanks. or should I say you are welcome? @codingjlu

Th3Coder (119)
And also, there are tons of mistakes in grammar and spelling. So if you find any, tell me and I will fix it 🤙🤙🤙

(DEEP BREATH)

So here you mistyped the off:

Here, you mistyped Statements and both Numbers.

Here you mistyped program and doesn't:

...keyword and are...

...programmers...

...and that's all I found! (There could be more though)

Don't worry though, in my previous tutorial I also made so many typos! I fixed most of them by now!

Also, you can add for loops, alert, confirm, switch cases, document objects, and importing modules!

Nevertheless though, I absolutely like it! Keep up the good work...

...and congrats on getting to the HOT section!

fifa21coin (0)

Thank you so much!! I learned a lot

OldWizard209 (1357)

Thanks. Hope it is useful, stay tuned for more topics coming on this. BTW, you can make a new comment also... @fifa21coin

OldWizard209 (1357)
  1. Thanks for the grammar errors corrections.
  2. Fixed all of them.
  3. I didn't add for loops because they are a little complex and need three different things you need to define. I will add them though.
  4. alert, confirm and document are not added because they require HTML and I don't want to go over HTML in an only JS Course.
  5. Switch is coming...

    "...and congrats on getting to the HOT section!"

Thanks...
Also, I got Grammarly to fix all the mistakes which you missed. OFC, you are not a computer. NEvertheless, I appreciate your effort in catching these mistakes. Thanks once again.

@Th3Coder

Th3Coder (119)

@OldWizard209 you're welcome!

Oh yeah, when comparing values with 0, true, or false we need to use triple (yes, triple) equal signs! ===

You can explain the pass and continue keywords as well!

Also, this might help to resolve errors:

//jshint maxerr: 100000
// Change the 100000 to whatever. JS will ignore errors as long as they don't bypass the number!

Also, I like your explanation. Very clear and good!

Th3Coder (119)

@OldWizard209 btw the off typo is still not fixed. You can add toString and parseInt as well! (Sorry if this too much to add though XD)

OldWizard209 (1357)

Here is my explanation:

OFF

Off is the opposite of on. As in switch on the light, opposite will be, switch off the light. So the off I used was to express the switch the false boolean value throws...

OF

Of is used to express the relationship between two things. So I am not expresiing any relation over here.

Now this is google's defenition of OF
and google's definition of OFF
Now. You decide what is correct.
@Th3Coder

Th3Coder (119)

@OldWizard209 well, switches have 2 values which are on and off...

Th3Coder (119)

@OldWizard209 no, what I mean is this typo:

Also, no tutorial is complete so I suggest you to change the title!

OldWizard209 (1357)

oh, you were talking about that. Sorry. @Th3Coder

Also, no tutorial if complete so I suggest you to change the title!

ANd, if you will be soooo pushy, FINE, i will change it...

Th3Coder (119)

@OldWizard209 oh sorry if I'm actually THAT pushy XD

codermaster8 (6)

Good Crash Course

Very good Tutorial!

codermaster8 (6)

I did not read it though but I just think it looks good :) @OldWizard209

bwoop (174)

I only knew HTML,CSS, and basic JS functions, but now, i no longer have to be ashamed of my lack of JS knowledge, i can finally say i know it all! Proceeds to not understand tutorial

OldWizard209 (1357)

lol, thanks. I you need any help, feel free to ask me. @bwoop

bwoop (174)

@OldWizard209 And congrats on making the monthly replit thing

RayhanADev (2127)

A tutorial... that's not for Python...?

OldWizard209 (1357)

Yeah, I kind of started getting annoyed by the number of Python tutorials there were and how no one made a real comprehensive tutorial for other languages, so I made this. @RayhanADev

ComputerProgr29 (0)

WOWOWOWOWOWOWOWOWOWOWOOWOWOWOOWOWOWOW!!!!!!!!!!!!!!!!!!!!

eh506249 (3)

The one thing you should have covered for loops. Before this i only knew processing javascript and now i know more. yay

IOP3 (852)

Most of the people already said the suggestions or mistakes in the tutorial so yeah. Epic tutorial by the way.

FlaminHotValdez (629)

thumbs up, helped me learn js

OldWizard209 (1357)

Great!! I am glad I was able to help. @FlaminHotValdez

IntellectualGuy (797)

I like it but the it could be structured way better

OldWizard209 (1357)

@Th3Coder , I added switch, typeof, parseInt, toString. I will not add for loops for now. Is the information right? Thanks in advance.

Th3Coder (119)

@OldWizard209 great! The information is correct!

ch1ck3n (1777)
(function() {
    'use strict';

    // Your code here...
})();

use that for anti-cheating

ch1ck3n (1777)

@OldWizard209 it prevents ppl from cheating using the e console

ch1ck3n (1777)

Note: It doesn't matter if you put the semi-colon or not
best practices to put semicolons, though

OldWizard209 (1357)

Yeah, i know. But I said that for people comming from different coding backgrounds. Like in Python, colons are not used. So most of the time, people who used python, will forget the semi-colon. But I will add that it is best practice tho. Thanks @ch1ck3n

ChopSueyMaster (29)

WOOW. I am already a full stack developer and dont need this, but this tutorial is sooo comprehensive and amazing. I love the hardwork. KEEP IT UP.

OldWizard209 (1357)

really? thanks. Can you give me a few tips on what can be improved in this tutorial? @ChopSueyMaster

[deleted]

@ChopSueyMaster I cannot believe that at all. I looked at your repls. Not full stack, I even don’t think I’m full stack or even that great and I have been doing this for 2months. And still suck

ChopSueyMaster (29)

bruh. I have been doing this for years. And btw, I work for a company and most of the projects are made on their computer, i have at home, mainly atom and vs code. I barely put anything on replit. Only if I want to use it ony my computer, which I rarely ever do. I only made a replit account to access my projects on my own laptop, but haven't used it yet.. @TestOP