Skip to content

Commit

Permalink
Practice
Browse files Browse the repository at this point in the history
  • Loading branch information
ByeonghoonJeon committed Aug 8, 2021
1 parent 7044328 commit 906794f
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 10 deletions.
36 changes: 26 additions & 10 deletions filterPractice/package.json
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"
]
}
16 changes: 16 additions & 0 deletions filterPractice/public/index.html
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>
25 changes: 25 additions & 0 deletions filterPractice/src/emojipedia.js
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;
18 changes: 18 additions & 0 deletions filterPractice/src/index.js
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.

0 comments on commit 906794f

Please sign in to comment.