In this video i explain How to convert number to string data type in javascript
I use + operator and empty string to convert number data type value to string data type value in javascript. Both number and string are primitive data types in javascript
const num= 123
const str= num + "";
console.log(str);
console.log(typeof str);
console.log(typeof num);
const num= 123
Here i declared num variable which is a number data type in javascript and i assigned a value 123
const str= num + "";
Then by using + operator and empty string , i converted num value to string data type in javascript.
Now i checked data type of both str and num using typeof operator of javascript
console.log(typeof str);
console.log(typeof num);
So we can convert number data type value in javascript to string data type value in javascript using + operator and empty string
Смотрите видео How to convert number data type to string data type in javascript using + operator and empty string онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Tech Nursery 03 Январь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 9 раз и оно понравилось 0 людям.