Is it used only for building websites?
With years, JS has surpassed its original use, and today we can use this programming language to build web and mobile applications, networking apps like chats and streaming services, video games, and much, much more.
This means that you have to be careful with variable names, function names, object names, etc. Variable named button is different from Button variable.
An identifier is a name you use for a declared variable, function, array, object, or any other parameter.
Your identifier name must follow two rules:
- The characters that you can use are letters (a-z, A-Z), numbers (0-9), underscores (_), and dollar signs ($).
- The first character can not be a number (0-9).
Note: It is highly recommended to use semicolon anyway, because it will make your code more readable and prevent potential errors.
You can make spaces, new lines, and indent the code as you wish. It will not affect your code, but can make it more easy to read.
If you want to use single line comment, you use two forward-slash characters // .
For block comments, you use a forward slash and asterisk /* and ends with the opposite sign */ .
It is a language that constantly evolves and today we can use it to build web and mobile applications, networking apps like chats and streaming services, video games, and much, much more.