#javascript
Read more stories on Hashnode
Articles with this tag
Sometimes we need something to be executed only once in our code, in JavaScript we can create a one-time function to do something only once. Take a...
You have an array of numbers and you need to know the minimum and maximum values of the array without having to traverse the entire array, don't worry...
Suppose we have an array of numbers: let numbers = [20,10,52,25]. To get the sum we usually use a for loop and traverse through the list right. You...
Sometimes we need to work with random values, imagine that you have an array of items and you need to get a random value from the array. We can start...
Sometimes we need to convert Strings to Numbers. The easiest and fastest way to convert strings to numbers would be using the + (plus) operator. Let's...
The ternary operator is a simplified conditional operator like if / else. Syntax: condition ? <expression if true> : <expression if false> Here is an...