Single-line comments start with //:
// This is a single-line comment
Multi-line comments start with /* and end with */:
This is a
Let's take a look at them briefly :
Strings are characters wrapped in single or double quotes: 'Sample String'
Numbers are any number without quotes: 23.8879
Booleans are either true or false
Operators and Expressions:
Booleans: A boolean is a data type that represents two possible values: true or false. It is often used in conditional statements to control the flow of a program. For example,** true or false.**
Null: The null value represents the intentional absence of any object value. It is often used to indicate that an object has no value. For example,** let x = null;
Undefined: The undefined value represents the absence of a value for a variable that has been declared but has not been assigned a value. For example,** let x; console.log(x); // Output: undefined**
Symbol: A symbol is a unique and immutable data type that is used to identify object properties. It was introduced in ECMAScript 6 and is useful for creating unique keys for objects. For example, let sym = Symbol();
Let's take an example. If we have a string "Hello", we can access its length property by using the dot operator (.) like this: "Hello".length. This will give us the number of characters in the string, in this case 5.
In addition to properties, objects can also have methods. Methods are actions that an object can perform. For example, if we have the string** "hello", we can convert it to uppercase by using the toUpperCase method like this: **"hello".toUpperCase().
Please feel free to share your thoughts and feedback/suggestions in the comments section below. I would love to hear from you .
Stay tuned for more informative blogs, and happy coding!
Let's learn and build together !
Top comments (0)