연산자

length-1·2023년 11월 24일

Javascript

목록 보기
6/8
consloe.log(1 + 2);
consloe.log(5 - 7);
consloe.log(3 * 4);
consloe.log(10 / 2);
consloe.log(7 % 5); // 나머지연산자

나머지 연산자 응용 (홀수 짝수 구분)

function isEven(num){
	return num % 2 === 0
}

isEven(3); // false
profile
Frontend Study Blog

0개의 댓글