12.11

홍왕열·2021년 12월 11일
0

오늘 배운 것

Math.sqrt(Number)

제곱근을 리턴해준다

toFixed()

숫자를 고정 소수점 표기법으로 표기해 반환한다.

Math.round()

입력값을 반올림한 수와 가장 가까운 정수 값을 반환합니다.

console.log(Math.round(0.9));
// expected output: 1

console.log(Math.round(5.95), Math.round(5.5), Math.round(5.05));
// expected output: 6 6 5

console.log(Math.round(-5.05), Math.round(-5.5), Math.round(-5.95));
// expected output: -5 -5 -6

arr.includes()

let digit = '0123456789'
console.log(digit.includes(2))
true

배열이 특정 요소를 포함하고 있는지를 판별한다.

배열이 아니어도 확인이 가능하다
let digit = '0123456789'
console.log(digit.includes(2))
//true

profile
코딩 일기장

0개의 댓글