This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"terminal.integrated.shell.linux": "/bin/zsh", | |
"terminal.integrated.fontFamily": "FiraMono Nerd Font", | |
"terminal.integrated.fontSize": 12, | |
"terminal.integrated.fontWeight": "normal", | |
"workbench.settings.editor": "json", | |
"editor.fontFamily": "Fira Code", | |
"editor.fontSize": 20, | |
"editor.fontWeight": "500", | |
"editor.fontLigatures": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"terminal.integrated.shell.linux": "/bin/zsh", | |
"terminal.integrated.fontFamily": "FiraMono Nerd Font", | |
"terminal.integrated.fontSize": 12, | |
"terminal.integrated.fontWeight": "normal", | |
"workbench.settings.editor": "json", | |
"editor.fontFamily": "Fira Code", | |
"editor.fontSize": 20, | |
"editor.fontWeight": "500", | |
"editor.fontLigatures": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function countSmileys(arr) { | |
let smiles = 0; | |
let eyes = [";", ":"]; | |
let noses = ["-", "~"]; | |
let mouth = [")", "D"]; | |
for (let i = 0; i < arr.length; i++){ | |
if (arr[i].length == 3){ | |
if (((eyes.indexOf(arr[i][0]) != -1)) && (noses.indexOf(arr[i][1]) != -1) && (mouth.indexOf(arr[i][2]) != -1)){ | |
smiles++; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Demonstrate all the different ways to iterate the below array | |
const myArray = [1, 2, 3, 4, 5, 6]; | |
// 1 method | |
for (let index = 0; index < myArray.length; index++) { | |
console.log(myArray[index]) | |
} | |
// 2 method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useReducer } from "react" //implement the useReducer | |
import { actions } from "./actions" //you can change the path depending where is it located the file actions | |
import { initialState } from "./constants" //you can change the path depending where is it located the file actions | |
import { reducer } from "./reducer" //you can change the path depending where is it located the file actions | |
export const Component = () =>{ | |
//implement the reducer | |
const [state, dispatch] = useReducer(reducer,initialState) | |
//reducer refers to the file and the changes that will be executed according to the actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//function that filters a commitment by one or more types of status | |
//filterWithStatus({...},["query1"...]) | |
export const filterWithStatus = (data, query) => { | |
const filteredData = data.filter((item) => { | |
for (let key in query) { | |
if (item.status === undefined) { | |
return false; | |
} else if (query[key].includes(item.status)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Commitments */ | |
[ | |
{ | |
"id": "1", | |
"createdAt": "2020-07-31T07:33:06.320Z", | |
"firstName": "Xander", | |
"lastName": "Satterfield", | |
"organization": "Agroindustria Honey Kaab", | |
"sector": "sector_publico", |