배열출력
-
[React] Key 값으로 출력하기FRONT-END/React 2020. 11. 5. 12:16
import React from 'react' import './App.css' import Counter from './Counter.js' import MyName from './MyName' export default class App extends React.Component{ state = { idx:7700, nick:'kim', idols:['orange','red','pink','black'], } render(){ let arr = this.state.idols; let str = []; // arr를 담아줄 배열 추가 //key값 사용 for(let i=0; i
-
[React] React 에서 배열 사용하기FRONT-END/React 2020. 11. 5. 12:07
| App.js import React from 'react' import './App.css' import Counter from './Counter.js' import MyName from './MyName' export default class App extends React.Component{ state = { idx:7700, nick:'kim', idols:['orange','red','pink','black'], } render(){ return( App.js )//return end }//render end }//class end | 배열 펼치기 let values = [3,1,3,5,2,4,4,4]; let uniqueValues = [...new Set(values)]; | 배열 웹페이..