Java script 46

[Java script] array_push_pop

arr = new Array(); arr = []; arr =[,,,,]; console.log(arr); arr = [1,2,3]; //[1,2,3]; //Array push() arr.push(3) //배열에 push넣으면 뒤에 추가적으로 하나가 더 붙음 [1,2,3,3] arr.push(4) //[1,2,3,3,4] arr.push(5) // [1,2,3,3,4,5] console.log(arr); //Array push의 반대, 항상 맨 마지막 값이 제거됨 arr.pop(); //[1,2,3,3,4] console.log(arr); arr.pop(); arr.pop(); //[1,2,3] 이것은 pop()을 사용하게되면 바로 결과물을 만들어 줌 arr.push(4); arr.push(5); arr..

Java script 2021.04.14

[Java script] display flex

DOCTYPE html> Document *{ margin:0; padding:0; } ul, li{list-style:none;} .gnb{display:flex; width:300px; height: 900px; flex-direction: column; /*column으로 바꿔주면 일자로... 높이값도 지정해주면 모바일에서도 가능 */ flex-wrap: wrap; /* gnb width 600px 넘어가면 아래로 떨어뜨리겠다. nowrap은 일자로 */ justify-content: center; /* flex박스 안에 영역 정렬 */ } .gnb > li { width:200px; height:300px; } .gnb > li:nth-child(1){background: red;} .gnb > ..

Java script 2021.04.12