1. How to Capitalize Text
Capitalize function which accepts some text and makes the first letter uppercase, then appends the rest of the string
The freecodecamp article only aims to show the code (and that's fine) and doesn't address how it might be applied, so in my learning path I try to show how these functions and concepts might be applied in a way that you can interact with them and see them working in a practical way. In some cases I have used the sample code exactly as it is in the article, and in other cases I have changed and added other things to make the example work.
Capitalize function which accepts some text and makes the first letter uppercase, then appends the rest of the string
Function to Calculate Percentage by entering the percentage and the total.
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.
Function that removes repeated elements from a given object.
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,}, ];
Function that compares 2 arrays or objects and delivers whether they are the same or different.
Function that counts how many times the same element is repeated in an array.
Array = ["Yes", "Yes", "No", "Yes", "No", "No", "Yes"];
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.
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 }, ];
This function allows you to insert an element into this array and specify where it should be placed.
initialArray = [ "Ignacio", "Santiago", "Javier", "Martin", "Tatiana" ];