JavaScript Interview Questions- Machine Coding - Most Asked Question

  Рет қаралды 4,896

Nisha Singla

Nisha Singla

Жыл бұрын

Javascript Interview Question on objects and Array will be discussed in this video .
Watch the complete video till the end to understand it completely
Checkout my Instagram account to find the latest notes on React, Angular and Javascript.
Instagram handler Name: @nishasingla05
Watch complete video to understand in depth.
Support my channel by liking and sharing my videos so that I can reach to wider audience. Please share it in your network 🙏
►Checkout JavaScript Interview Playlist
• Frontend Interview Que...
►Checkout ES6 Playlist
/ playlistlist=plc8okhrv...
►Click here to Subscribe the channel:
studio.kzbin.info/door/...
►Angular Complete Course:
kzbin.info/aero/PLC...
►All important shorts videos:
kzbin.info/aero/PLC...
Connect with Me On Social Media
Facebook: / angularjs4be. .
LinkedIn: / nisha-sin. .
Instagram : / nishasingla05
Twitter: / nishasingla05
#nishasingla #javascript #interview

Пікірлер: 10
@VinitNeogi
@VinitNeogi Жыл бұрын
Should we use data.forEach instead of data.map as we are not concerned with return value of map function?
@amitbm3608
@amitbm3608 Жыл бұрын
Thank u for the awesome video. Please continue react tutorial and complete the series.
@sivatirumani531
@sivatirumani531 Жыл бұрын
Nice Explanation
@pranavpawar7792
@pranavpawar7792 10 ай бұрын
Wow such a nice explanation... I really liked your approach and logic... Thanks Nisha
@DanielSparza
@DanielSparza Жыл бұрын
Thanks for do this kind of videos
@akiratoriyama1320
@akiratoriyama1320 Жыл бұрын
Thank you!!
@Aravind-mh5wh
@Aravind-mh5wh 9 күн бұрын
we can write using ternary operator like below let ar = ['a','s','s','b','c','a','c','d','a','s']; function arrOccurances(items){ let output = {}; items.forEach(item=>{ output[item] = output[item] ? output[item]+1 : 1 }) return output; } console.log(arrOccurances(ar)); (OR) let ar = ['a','s','s','b','c','a','c','d','a','s']; let output = {}; for(let item of ar){ output[item] = output[item] ? output[item]+1 : 1 } console.log(output) ; not only these ways, as Nisha said we have many ways to do it. Thanks Nisha :-)
@websilt
@websilt Жыл бұрын
Another way to do this: const items = ["a", "b", "c", "a", "b", "b", "c", "d"]; const count = {}; for (const item of items) { if (count[item]) { count[item] += 1; } else { count[item] = 1; } } console.log(count);
@kavinkumar
@kavinkumar 4 ай бұрын
well if you cant use map , let arr=['a','b','z','a','b','a','c'] let obj={}; for (let key in arr) { console.log(obj[arr[key]],arr[key]); //undefined , a initially obj[arr[key]]?obj[arr[key]]=obj[arr[key]]+1:obj[arr[key]]=1; } console.log(obj) { a: 3, b: 2, c: 1, z: 1 }
@Aravind-mh5wh
@Aravind-mh5wh 9 күн бұрын
last line of code is repeated , so simply we can write like below obj[arr[key]] = obj[arr[key]] ? obj[arr[key]]+1 : 1;
Introduction To Testing In JavaScript With Jest
13:57
Web Dev Simplified
Рет қаралды 490 М.
ТАМАЕВ vs ВЕНГАЛБИ. Самая Быстрая BMW M5 vs CLS 63
1:15:39
Асхаб Тамаев
Рет қаралды 4 МЛН
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 24 МЛН
ГДЕ ЖЕ ЭЛИ???🐾🐾🐾
00:35
Chapitosiki
Рет қаралды 11 МЛН
Angular custom directive and custom pipe example
1:55
Rui Wang
Рет қаралды 82
MUST KNOW junior role JAVA interview questions
42:15
Keep On Coding
Рет қаралды 97 М.
Top 25 JavaScript Interview Questions for Beginners
50:26
Interview Happy
Рет қаралды 264 М.
Javascript LIVE Coding Interview (Mock) #javascript #reactjs
31:22
What is Recursion | Javascript | Real World Examples
26:35
Nisha Singla
Рет қаралды 12 М.
ТАМАЕВ vs ВЕНГАЛБИ. Самая Быстрая BMW M5 vs CLS 63
1:15:39
Асхаб Тамаев
Рет қаралды 4 МЛН