Kurniawan”); The code above does not have an error because (lastName = “Kurniawan”) is an expression. let fullName = “Kurniawan” + “Widodo”; The code above does not have an error because “Kurniawan” + “Widodo” is also an expression. Through the code example above, we can imagine a variable as a box or container that stores values. The initialization or assignment process means we enter values into the box. Each variable has a name that we can call and use. We can name variables with any name, but make sure the name still makes sense in the context so that the code is easy to maintain . It’s best to avoid naming variables with general terms like “data”. Use variable names that describe the value of the variable itself. Here are some rules for naming variables that you need to know: Must start with a letter or underscore .
Can consist of letters numbers and underscore
Various combinations. Must not contain spaces (whitespace). If the variable name is more than two words, write it in camelCase. Example firstName, lastName, catName, etc. Must not contain special characters hen, what about const? Const whatsapp database is short for constant . This means that we will declare a variable const when we want the variable to have a constant value and cannot be changed after its value has been initialized. Think of a const variable as a box that is closed and sealed once filled, so that its value cannot be changed again. Other Components in JavaScript What do you think? There are still many other components that need to be studied such as Data Types, Operators, If/Else Statements, Switch Case Statements, Loops, and so on.
Write Your First JavaScript Code
Also read the following selected articles: Cloud and Back-End Developer Scholarship is Now Open 5 JavaScript Frameworks for Web Programmers 5 Reasons Why JavaScript is Important for Web Programmers Registration for the Cloud SAB Directory and Back-End Developer Scholarship Program is open for 100,000 general participantsWhat is efficiency? Definition and examples Uncategorized What is Efficient? Definition and Examples Internal Dicoding April 28, 2021 Hello friends! Do you often hear the word efficient? Some people may already know the meaning of the word “efficient”. However, each person will interpret the meaning of the word efficiency differently.