emojipedia.js 파일 내용 안에서 index.js로 meaning만 빼와보자.
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;
간단하게 map() 함수를 이용한다.
emojipedia.map() 함수 안에 익명 함수를 넣는다.
string을 100자까지 truncate 하기
결과 담기
결과
'React > React Basic' 카테고리의 다른 글
[React] Ternary Operator | && | Single responsibility | 로그인, 사인업 플로우| Expression vs Statement | Conditional Rendering | (0) | 2022.03.17 |
---|---|
[React] Arrow Function (0) | 2022.03.16 |
[React] forEach(), map(), filter(), reduce(),find(),include() (0) | 2022.03.14 |
[React] Mapping Data | 이모티콘 사전 | dl dt dd (0) | 2022.03.14 |
[React] Map() | functional programming | Mapping Data to Components (0) | 2022.03.13 |
댓글