Skip to content

Instantly share code, notes, and snippets.

View hebertcisco's full-sized avatar
🎯
Focusing

Hebert F. Barros hebertcisco

🎯
Focusing
View GitHub Profile
@hebertcisco
hebertcisco / while.ts
Created May 23, 2020 05:21
The while statement creates a loop that executes a specific routine while the test condition is evaluated as true. The condition is evaluated before the routine is executed.
const mySkills = [
"C#",
"JavaScript",
"TypeScript",
"HTML",
"CSS3",
"Angular",
"ReactJS",
"React Native",
"NodeJs",
@hebertcisco
hebertcisco / dowhile.ts
Created May 23, 2020 05:23
The do while statement creates a loop that executes a statement until the condition test is false. The condition is evaluated after the code block is executed, resulting in a declaration being executed at least once.
const mySkills = [
"C#",
"JavaScript",
"TypeScript",
"HTML",
"CSS3",
"Angular",
"ReactJS",
"React Native",
"NodeJs",
@hebertcisco
hebertcisco / every.ts
Created May 23, 2020 05:24
Say if all users are authorized using age as a parameter:
const ageUser = [
{
name: "Jane Dow",
age: 39,
},
{
name: "John Doe",
age: 39,
},
{
@hebertcisco
hebertcisco / filter.ts
Created May 23, 2020 05:25
The filter() method creates a new array with all the elements that have passed the test implemented by the provided function. Filter only the even numbers of the Fibonacci sequence:
const fibonacciSequence = [
0,
1,
1,
2,
3,
5,
8,
13,
21,
@hebertcisco
hebertcisco / for.ts
Created May 23, 2020 05:27
A for loop is a control flow statement to specify the iteration, which allows the code to be executed repeatedly.
const mySkills = [
"C#",
"JavaScript",
"TypeScript",
"HTML",
"CSS3",
"Angular",
"ReactJS",
"React Native",
"NodeJs",
@hebertcisco
hebertcisco / forin.ts
Created May 23, 2020 05:28
The for in loop interacts over an object's enumerated properties, in the original order of insertion. The loop can be performed for each distinct object property.
const team = [
{
name: "John Doe",
occupation: "Web Design",
},
{
name: "Jane Doe",
occupation: "photographer",
},
];
@hebertcisco
hebertcisco / forof.ts
Created May 23, 2020 05:28
loop for of loops through iterative objects (including Array, Map, Set, the arguments object and so on), calling a custom function with instructions to be executed for the value of each distinct object.
const mySkills = [
"C#",
"JavaScript",
"TypeScript",
"HTML",
"CSS3",
"Angular",
"ReactJS",
"React Native",
"NodeJs",
@hebertcisco
hebertcisco / foreach.ts
Created May 23, 2020 05:29
One declaration for each in repeating a specified variable over all values ​​of the object's properties. For each distinct property, a specific declaration is executed.
const mySkills = [
"C#",
"JavaScript",
"TypeScript",
"HTML",
"CSS3",
"Angular",
"ReactJS",
"React Native",
"NodeJs",
@hebertcisco
hebertcisco / map.ts
Created May 23, 2020 05:30
The map () method invokes the callback function passed by argument for each element of the Array and returns a new Array as a result.
const temperatureCelsius = [0, 22, 31, 40, 45, 12, 3];
const toFahrenheit = (value) => (value * 9) / 5 + 32;
const temperatureFahrneheit = temperatureCelsius.map(toFahrenheit);
console.log(temperatureCelsius);
console.log(temperatureFahrneheit);
@hebertcisco
hebertcisco / reduce.ts
Created May 23, 2020 05:31
The reduce() method performs a reducing function (download for you) for each element of the matrix, resulting in a single return value.
const githubStars = [
{
userID: "tecnobert",
userStars: 88,
},
{
userID: "philipwalton",
userStars: 36,
},
{