Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Arrays

Creating Arrays

변수 숫자 = [1, 2, 3, 4, 5]
변수 빈배열 = []

Indexing

출력(숫자[0])     // 1
출력(숫자[-1])    // 5 (negative indexing)
숫자[0] = 99      // mutation

Methods

MethodDescriptionExample
.추가(값)Append elementarr.추가(6)
.삭제(인덱스)Remove at indexarr.삭제(0)
.길이()Lengtharr.길이()5
.포함(값)Containsarr.포함(3)
.역순()Reverse (new array)arr.역순()
.정렬()Sort (new array)arr.정렬()
.합치기(구분자)Join to stringarr.합치기(", ")

Iteration

반복 항목 안에서 [1, 2, 3] {
    출력(항목)
}