0

JavaScript

do you make up your own words when writing JavaScript codes?

14th Feb 2025, 5:41 AM
Ivory Paul Ferolino (Ivory)
Ivory Paul Ferolino (Ivory) - avatar
2 ответов
0
There are keywords for functions, variables, conditions etc. For example, the "let" is a keyword for creating a variable, "for" and "while" are keywords for creating a for and a while loop. "function" is a keyword for declaring a function, "if", "else if" and "else" are keywords for creating conditionals statements, "class" is a keyword for creating a custom class, etc. You cannot use any other words for these keywords, neither can you use these for naming something(you can combine them with your own words for naming though). Names for variables, functions, classes and more are words you make up yourself however you want(while following the naming requirements). Like: let myVariable = "I love JavaScript!"; function demo(myArgName) {} class MyNamedClass {}
14th Feb 2025, 6:32 AM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
0
As Afnan pointed out, there are reserved keywords which let Javascript know you want to perform certain types of actions, just like every other programming language. Any decent code editor or IDE will have "code highlighting" which will mark keywords, strings, data types in different colors.
14th Feb 2025, 8:38 AM
Shardis Wolfe