algorithm Study/Today I Learn 2019. 4. 7. [TIL] 2019.04.05 - Algorithm ~ 연산자 (물결) 알고리즘을 풀다가 다른 사람이 javascript 에서 저런 문법을 사용해서 알아보았다. ~ 연산자는 비트연산자의 Bitwise NOT 으로 연산은 다음과 같다 ~n == -(n+1) ~1 == -(1+1) == -2 -~a == -(-(a+1)) == a+1 Math.sqrt(x) x의 제곱근을 반환, 음수면 NaN을 반환 Math.sqrt(9); // 3 Math.sqrt(2); // 1.414213562373095 Math.sqrt(1); // 1 Math.sqrt(0); // 0 Math.sqrt(-1); // NaN Array.prototype.every() 배열안에 모든 요소가 주어진 판별 함수를 통과하는지 테스트 function isBelowThreshold(current.. 이전 1 다음