Welcome to the Tutorial!

Java

Syntax

The rules that determine how JavaScript programs are made are called syntax. The syntax establishes two types of values; these two values are fixed and variable values but fixed vaues are referred to as literals whilst variable values are referred to as variables. Things that fall under the literals umbrella are numbers and strings and variables are meant to store different values.

Outputs

JavaScript outputs are exactly what they sound like, it's the data that JavaScript will show when you run certain code. Onclick buttons are something that can cause an output like an alert.


Comments

Comments are pieces of texts in the backend of your code that start with // and any text at the beginning and end of the tag will not be preformed. You can also use /* if the comment you are making is more than one line long but you have to close the comment using */ other than that, it's function is exactly the same as a normal comment. These tags are used so that coders can leave a statement for other coders to read and act accordingly, to leave notes for what you need to change, to explain code, and to test your coding. Example for // comments Example for /* comments

Variables

Variables in JS are used to store information. You can use either var, let, or const to make something a variable. They are interchangable, however, you should use var in older browsers because it was added first. Plus, if you think the variable may change, you should use let but otherwise you should use const or var. If you are using let or const they will not let you declare a variable twice, so you can't have two x= with them.
Example of how to use variables

Functions

JS functions are blocks of code that are made to do a certain task and are only run when something calls it. To use a function, you use the function keyword then a name and then (). With functions you can use the same code over and over without having to redo it each time. Example for functions


Operators

JS operators are the symbols that we use to do operations on varaibles like addition or subtraction. Operators can be used in more than one ways depending on where you put it. As an example, addition can be used to add numbers together and to concatenate strings together. The different kinds of operators are arithmetic, assignment, comparison, logical, conditional, and type.

Data Types

Data types in JS is what everything is considered as. There are eight data types being strings, numbers, bigint, boolean, undefined, null, symbol, and objects. Strings are anything inside of quotes. Numbers are any number that has a decimal or is a whole number, fractions do not work with JS. Bigint is used to store any integer that are too large to be represented by a normal JS number. Booleans only have the two values true and false. Undefined is any variable without a value. Null is just nothing, it is something that doesn't exist. Symbols are unique identifiers that are always unique no matter what and they have optional descriptions you can add to them. Objects can be a date, an array, or just an object but it has to be surronded with {}.