https://www.w3schools.com/js/js_type_conversion.asp
JavaScript Type Conversions
JavaScript Type Conversion Number() converts to a Number, String() converts to a String, Boolean() converts to a Boolean. JavaScript Data Types In JavaScript there are 5 different data types that can contain values: string number boolean object function Th
www.w3schools.com
- typeof operator always returns a string (containing the type of the operand) ex) typeof 'hello' // "string"
- You cannot use typeof to determine if a JavaScript object is an array (or a date) --> Array.isArray()
- convertToString: String()
- convertToNumber: Number()
- isTruthy: Boolean(true) // isFalsy: !Boolean(true)
'Today I learned > JavaScript' 카테고리의 다른 글
[JavaScript] 화살표 함수 표현 vs function 표현 (0) | 2019.12.18 |
---|---|
[JavaScript] in 연산자 (0) | 2019.10.24 |
[JavaScript] Javascript의 Object를 다루는 몇가지 팁들 (0) | 2019.10.24 |
[JavaScript] Object Methods(keys(), values()) (0) | 2019.10.24 |
[JavaScript] for...in 문 (0) | 2019.10.24 |