tofixed TIL_20210403 부정확한 계산 정밀도 손실(loss of precision) toFixed는 항상 문자열을 반환한다는 점에 유의, 문자열을 반환하기 때문에 소수점 다음에 오는 숫자가 항상 2개 문자형으로 바뀐 숫자를 다시 숫자형으로 강제 변환하려면 단항 덧셈 연산자를 사용... 자료형tofixed숫자형tofixed [JS] converting and checking numbers, Math and rounding, remainder operator,Numeric Separators, bigInt 강의 출처 : The Complete JavaScript Course 2022 Jonas (Udemy) parseInt, parseFloat => global functions Number을 굳이 안붙혀도 되지만, 요즘은 붙혀서 적는 추세! Check if value is NaN. data type이 NaN인지를 확인한다. console.log(Number.isNaN(20)); //false... parseIntnumberic seperatorsMath.PIparseFloatMath.randomtofixedisIntegerisFiniteBigIntremainder operatorisNaNBigInt
TIL_20210403 부정확한 계산 정밀도 손실(loss of precision) toFixed는 항상 문자열을 반환한다는 점에 유의, 문자열을 반환하기 때문에 소수점 다음에 오는 숫자가 항상 2개 문자형으로 바뀐 숫자를 다시 숫자형으로 강제 변환하려면 단항 덧셈 연산자를 사용... 자료형tofixed숫자형tofixed [JS] converting and checking numbers, Math and rounding, remainder operator,Numeric Separators, bigInt 강의 출처 : The Complete JavaScript Course 2022 Jonas (Udemy) parseInt, parseFloat => global functions Number을 굳이 안붙혀도 되지만, 요즘은 붙혀서 적는 추세! Check if value is NaN. data type이 NaN인지를 확인한다. console.log(Number.isNaN(20)); //false... parseIntnumberic seperatorsMath.PIparseFloatMath.randomtofixedisIntegerisFiniteBigIntremainder operatorisNaNBigInt