*테스트1 *테스트2 *테스트3 *테스트4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//이코드는 테스트 파일 입니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//예외처리 | |
function checkArg(sArgs,sType){ | |
for(i=0; i < sArgs.length; i++){ | |
if(sArgs[i] !== sType) return false | |
} | |
return true | |
} | |
//1week_homework |
#JAVAscript array API
##array.concat
var arr1 = ["a", "b", "c"];
var arr2 = ["d", "e", "f"];
var arr3 = arr1.concat(arr2);
// results in a new array [ "a", "b", "c", "d", "e", "f" ]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1week_homework | |
//인자값 예외처리 하지 않음.(숫자 확인) | |
//1번 문제 : 입력받은 값 까지의 홀수 출력 | |
function getOdd(num){ | |
for(i=1;i <= num; i = i+2){ | |
console.log(i) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 에라토스테네스의 체 | |
// N배열을 생성을 한다. | |
// 1을 삭제, | |
// 2를 제외한 2의 배수를 지움 | |
// 3을 제외한 3의 배수 지움 | |
// 4는 없어서 패스 | |
// 5는 제외하고 5의 배수 지움 | |
// 반복 | |
function sosu_arr(num){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//동일한ID 오브젝트 삭제 | |
var myArr = [ | |
{"id" : 23, "name" : "honux", "content" : "오늘의 커피는 왜 항상 맛있지?", "like" : 2, "comment" : ["^^", "i like this"]}, | |
{"id" : 55, "name" : "nigayo", "content" : "드디어 출근!", "like" : 4, "comment" : ["이직 하셨나봐요? "]}, | |
{"id" : 93, "name" : "jk", "content" : "어제 읽은 책이 아직도 ", "like" : 20, "comment" : ["잠자기 전에 만화책은 금물..", "그게 뭘까?"]}, | |
{"id" : 4, "name" : "crong", "content" : "코드스쿼드가 정말 좋은 곳일까? 믿을 수가 없다..", "like" : 0, "comment" : ["누가 그러디"]} | |
] | |
var objSameId = function(e,i,a){ | |
if(a[i].id === index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
var input_stdin = ""; | |
var input_stdin_array = ""; | |
var input_currentline = 0; | |
process.stdin.on('data', function (data) { | |
input_stdin += data; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
var input_stdin = ""; | |
var input_stdin_array = ""; | |
var input_currentline = 0; | |
process.stdin.on('data', function (data) { | |
input_stdin += data; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyArray { | |
constructor() { | |
this.arr = []; | |
} | |
get(index) { | |
return this.arr[index]; | |
} | |
insert(index, value) { |
OlderNewer