Visual Studio Code 자바스크립트 실행 확인 가능하도록 추가 설치
자바스크립트를 Visual Studio Code를 이용하여 작성하였을 때 제대로 작성되었는지 확인을 하기 위해 추가로 Node.js를 설치해야 합니다. Node.js의 설치 파일 다운로드 방법과 설치 방법에 대해 알아보
mr-johndoe.tistory.com
node.js가 설치된 상태에서 JavaScript Debug Terminal을 클릭하여 아래와 같이 실행을 해보았다.
// Your mission here is to create a function that gets an array and returns a tuple with 3 elements
//- the first, third and second element from the last for the given array.
// Input: A tuple, at least 3 elements long.
// Output: A tuple.
// Example:
easyUnpack([1, 2, 3, 4, 5, 6, 7, 9]) == [1, 3, 7]
easyUnpack([1, 1, 1, 1]) == [1, 1, 1]
easyUnpack([6, 3, 7]) == [6, 7, 3]
function easyUnpack(elements) {
return [elements[0], elements[2], elements[elements.length - 2]];
}
console.log('Example:');
console.log(easyUnpack([1, 2, 3, 4, 5, 6, 7, 9]));
'자바스크립트' 카테고리의 다른 글
checkio. nonUniqueElements (0) | 2022.06.04 |
---|---|
유명한 짤로 보는 자바스크립트 ==와 === (0) | 2022.06.04 |
replace() / JSON.stringify() / indexOf() (0) | 2022.01.09 |
[SweetAlert] alert 창을 예쁘게 (0) | 2022.01.09 |
파비콘(favicon) 만들기 (0) | 2021.12.30 |