How To
What does !== mean in javascript
By Tan Lee Published on Dec 18, 2024 133
The `!==` operator in JavaScript is a strict inequality operator. It compares whether two values are not equal in both value and type, returning `true` if they are either not equal or of different types.
What is ternary operator in Javascript
By Tan Lee Published on Dec 18, 2024 122
The ternary operator, also known as the conditional operator, is a shorthand for an if-else statement in JavaScript. It takes three operands: a condition, a value to return if the condition is true, and a value to return if the condition is false.
How to use getElementById() in Javascript
By Tan Lee Published on Dec 18, 2024 207
The `getElementById()` method in JavaScript is used to select and retrieve an HTML element with a specified `id` attribute.
How to use for loop in Javascript
By Tan Lee Published on Dec 18, 2024 150
In JavaScript, a `for` loop is used to repeatedly execute a block of code a specific number of times.
How to use switch in Javascript
By Tan Lee Published on Dec 18, 2024 136
In JavaScript, the `switch` statement is used to perform different actions based on various conditions, similar to a series of `if...else` statements.
How to use .length in Javascript
By Tan Lee Published on Dec 18, 2024 172
In JavaScript, `.length` is a property that returns the number of items in an array or the number of characters in a string.
How to use `Object.values()` in JavaScript
By Tan Lee Published on Dec 18, 2024 142
The `Object.values()` method in JavaScript retrieves an array of an object's own enumerable property values, collecting all the values and returning them in array format.
How to use split() in Javascript
By Tan Lee Published on Dec 18, 2024 119
The `split()` method in JavaScript splits a string into an array of substrings, using a specified separator.
How to create a function Javascript
By Tan Lee Published on Dec 18, 2024 156
To create a function in JavaScript, you can use this simple syntax:
How to get milliseconds in Javascript
By Tan Lee Published on Dec 18, 2024 163
In JavaScript, you can get the current time in milliseconds using either `Date.now()` or the `getTime()` method of a `Date` object.
What is const in Javascript
By Tan Lee Published on Dec 18, 2024 181
`const` is a JavaScript keyword used to declare a variable whose value cannot be reassigned after initialization.
What Does `setInterval()` Mean in JavaScript
By Tan Lee Published on Dec 18, 2024 164
`setInterval()` is a JavaScript function that repeatedly executes a piece of code at a specified time interval.