This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 isAnagram(a ,b) { | |
if(a ===b) return true; | |
return (resort(a) === resort(b)); | |
function resort(s) { | |
return s.split("").sort().join(""); | |
} | |
} |
This file contains 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
var i=1,cal; | |
for (;i<=100;i++) { | |
cal = (i%15===0) ? 'FizzBuzz' : (i%3===0) ? 'Fizz' : (i%5===0) ? 'Buzz' : i; | |
console.log(cal); | |
} |
This file contains 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
/* http://www.smartstudy.co.kr/data/dev_2012.html */ | |
/* 정의역이 실수인 반올림 함수 */ | |
function MyRound(f) { | |
return parseInt(f + 0.5, 10); | |
} | |
/* | |
정의역이 정수일때 gamma(n+1) == n! 을 이용한 factorial 함수 | |
gamma 함수는 실수의 factorial 을 계산하기 위한 적분 함수이지만 실수에 대한 처리부분이 빠져있기에 |