-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7044328
commit 906794f
Showing
4 changed files
with
85 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
{ | ||
"name": "filterpractice", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} | ||
"name": "map-filter-reduce", | ||
"version": "1.0.0", | ||
"description": "", | ||
"keywords": [], | ||
"main": "src/index.js", | ||
"dependencies": { | ||
"react": "16.8.6", | ||
"react-dom": "16.8.6", | ||
"react-scripts": "3.2.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "3.3.3" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
}, | ||
"browserslist": [ | ||
">0.2%", | ||
"not dead", | ||
"not ie <= 11", | ||
"not op_mini all" | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>React App</title> | ||
<link | ||
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link rel="stylesheet" href="styles.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script src="../src/index.js" type="text/jsx"></script> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const emojipedia = [ | ||
{ | ||
id: 1, | ||
emoji: "💪", | ||
name: "Tense Biceps", | ||
meaning: | ||
"“You can do that!” or “I feel strong!” Arm with tense biceps. Also used in connection with doing sports, e.g. at the gym." | ||
}, | ||
{ | ||
id: 2, | ||
emoji: "🙏", | ||
name: "Person With Folded Hands", | ||
meaning: | ||
"Two hands pressed together. Is currently very introverted, saying a prayer, or hoping for enlightenment. Is also used as a “high five” or to say thank you." | ||
}, | ||
{ | ||
id: 3, | ||
emoji: "🤣", | ||
name: "Rolling On The Floor, Laughing", | ||
meaning: | ||
"This is funny! A smiley face, rolling on the floor, laughing. The face is laughing boundlessly. The emoji version of “rofl“. Stands for „rolling on the floor, laughing“." | ||
} | ||
]; | ||
|
||
export default emojipedia; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var numbers = [3, 56, 2, 48, 5]; | ||
|
||
function double(x) { | ||
return x * 2; | ||
} | ||
|
||
const newNumbers = numbers.map(double); | ||
console.log(newNumbers); | ||
|
||
//Map -Create a new array by doing something with each item in an array. | ||
|
||
//Filter - Create a new array by keeping the items that return true. | ||
|
||
//Reduce - Accumulate a value by doing something to each item in an array. | ||
|
||
//Find - find the first item that matches from an array. | ||
|
||
//FindIndex - find the index of the first item that matches. |