string to num, num to string example

soom·2020년 9월 15일
0
post-thumbnail
post-custom-banner
// 강의와 관련된 코드를 직접 작성하고 콘솔에서 확인해주세요!!
console.log(parseInt("1.901"));
console.log(parseFloat("1.901"));
console.log(Number("1.901"));
console.log(parseInt("200") + 1);

var numberAsNumber = 1234;
var numberAsString = numberAsNumber.toString();

console.log(numberAsNumber, typeof numberAsNumber);
console.log(numberAsString, typeof numberAsString);

var numberAsNumber = 1234;
var numberAsString = 1234 + "";

console.log(numberAsNumber, typeof numberAsNumber);
console.log(numberAsString, typeof numberAsString);

var numberAsNumber = "1234";
var numberAsString = numberAsNumber - 0;

console.log(numberAsNumber, typeof numberAsNumber);
console.log(numberAsString, typeof numberAsString);
profile
yeeaasss rules!!!!
post-custom-banner

0개의 댓글