자바스크립트

자바스크립트_자료형검사

subdong7 2017. 1. 15. 13:14

● 자료의 형태 검사

typeof 연산자를 이용


ex.1) alert( typeof('string') );

alert( typeof(123) );


result.1) string

number


● 단항 연산자

-50 양수를 음수로 음수를 양수로 바꾸는 - 기호

-(50)


typeof 연산자


● 이항연산자

50 * 10




출처 책 : 모던 웹을 위한 JavaScript jQuery 입문 by 윤인성