코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Array Object</title> </head> <body> <h1>slice() 메소드</h1> <script> var arr = [1, true, "JavaScript", "자바스크립트"]; document.write(arr.slice(1, 3) + "<br>"); // [true,JavaScript] document.write(arr.slice(1)); // [true,JavaScript,자바스크립트 ] </script> </body> </html>