1. How to Capitalize Text

Capitalize function which accepts some text and makes the first letter uppercase, then appends the rest of the string

Result:

<See code/>

					

2. How to Calculate Percent

Function to Calculate Percentage by entering the percentage and the total.

Result:

<See code/>

					

3. How to Get a Random Element

Function to get a random element in a given array.Each time you run the function it delivers a different random result than the previous one.


Result:

<See code/>

					

4. How to Remove Duplicate Elements

Function that removes repeated elements from a given object.

Result:

<See code/>

					

5. How to Sort Elements By Certain Property

Function that sorts arrays and objects by a chosen property.

lessons = [

{position:0, name:'Intro', duration:18,},

{position:1, name:'Basics', duration:12,},

{position:2, name:'Advanced', duration:15,},
];
			

Result:

<See code/>

					

6. How to Check if Arrays/Objects are Equal

Function that compares 2 arrays or objects and delivers whether they are the same or different.


Result:

<See code/>

					

7. How to Count Number of Occurrences

Function that counts how many times the same element is repeated in an array.

Array = ["Yes", "Yes", "No", "Yes", "No", "No", "Yes"];
			

Result:

<See code/>

					

8. How to Wait for a Certain Amount of Time

Function to wait a certain time for something.
In this case, the time entered is displayed as a countdown in milliseconds.
At the end, a finished message is triggered.

Result:

<See code/>

					

9. How to Use the Pluck Property from Array of Objects

The function maps over this array and returns only the values of the property that we specified.

users = [

{ name: "Abe", age: 45 }, 

{ name: "Jennifer", age: 27 },

{ name: 'Paul', age: 31 },

];
				

Result:

<See code/>

					

10. How to Insert an Element at a Certain Position

This function allows you to insert an element into this array and specify where it should be placed.

initialArray = [

"Ignacio", "Santiago", "Javier", "Martin", "Tatiana"

];
				

Result:

<See code/>