ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • split , pop 간단설명
    카테고리 없음 2024. 7. 30. 21:38

    split 의뜻은 분열되다 로

     

    const a= "서울,부산,경기"

    const b= b.split(",")

    document.write(b[0])

    document.write(b[1])

    document.write(b[2])

     

    를 하면 결과 값으로 서울부산경기가 된다

     

    pop 은 배열 안에있는 마지막 요소 를 삭제한다

     

    const  array=[a,b,c,d]

    array.pop 을 사용하면

    array=[a,b,c]만 남게된다

     

Designed by Tistory.