comma operator in javascript different use cases with examples

Опубликовано: 11 Январь 2023
на канале: Tech Nursery
47
0

if you want to know what is comma operator and its advantages in javascript,then this video is for you .Here we discuss about comma operator different use cases in javascript with examples

comma operator evaluates from left to right, and returns the value of the right expression

So keep the above sentence in mind,then you can easily understand the use cases and advantages of comma operators in javascript

//comma operator evaluates from left to right, and returns the value of the right expression


let x = 100;
let y=(x++,x,x+1);
console.log(y) //102

let num = (100, 100 + 200);
console.log(num); //300

let result = (1,2,3,4,5)
console.log(result) //5


Смотрите видео comma operator in javascript different use cases with examples онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Tech Nursery 11 Январь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 47 раз и оно понравилось 0 людям.