Javascript Interview Questions ( Objects ) - Output Based, Destructuring, Object Referencing, etc

  Рет қаралды 138,874

RoadsideCoder

RoadsideCoder

Күн бұрын

Пікірлер: 186
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
🔴 Get my Complete Frontend Interview Prep course - roadsidecoder.com/course-details
@chinmoyborah376
@chinmoyborah376 2 жыл бұрын
For me , a great video for revision. Thanks. Just a minor thing I would like to add for deep and shallow copy. While we use Object.assign({}, obj) or use spread operator {...obj} , only the primitive objects inside the main object gets deep cloned into new object. For the nested objects, only the reference is stored, which is basically shallow copy.
@supriyabiradar3996
@supriyabiradar3996 27 күн бұрын
So basically Object.assign and spread operator are creating shallow copy and not deep copy?
@prangshugogoi5624
@prangshugogoi5624 2 жыл бұрын
Kindly make a video on interview questions on cookies , local storage & session storage … also to mention nice explanation on the topics , Thank you 🙏
@tpadma7419
@tpadma7419 8 ай бұрын
100% interview preparation..........very very thankfull...waiting for more such videos.....
@RoadsideCoder
@RoadsideCoder 8 ай бұрын
Checkout the full course here - roadsidecoder.com/course-details
@kmsnymisha4607
@kmsnymisha4607 2 жыл бұрын
Can you please explain why the members array remained same when person is set to null and why it changed to null only on changing the name property in the person object at 21:50
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Because we are reassigning the value which replaces the previous object, but in case of name properly, we are changing the value of that key which has the reference to the original object.
@crazyvaleideas
@crazyvaleideas 2 жыл бұрын
I didn't find such a great video on Internet !! Thanks, man for such amazing content❤️Keep posting such content !!
@ashuprakash6697
@ashuprakash6697 2 жыл бұрын
Can you provide a link or something related to property you discussed at timestamp 22:32, where you set person to null? It would be really helpful.
@girishanavani8620
@girishanavani8620 2 жыл бұрын
Great video! Also, a video on local storage, session storage, and Indexed DB with the use case would be a great one.
@code-of-duty
@code-of-duty 2 жыл бұрын
Question 2 : 7:15 -> Answer function multi2(obj) { return Object.entries(obj).reduce((acc, curr) => ({ ...acc, [curr[0]]: isNaN(curr[1]) ? curr[1] : curr[1]*2 }), {}) }
@sunilr.v.6345
@sunilr.v.6345 2 жыл бұрын
how well you have explained such complex topics ... great work ....keep it up ..!!!!
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Thank you, I will
@adnantariq3346
@adnantariq3346 Жыл бұрын
5:38 Trying to loop through an object will NOT work in react. it will give "'key' is not defined"
@shash0_0
@shash0_0 8 ай бұрын
Your content is highly underappreciated. Thanks for your work!
@RoadsideCoder
@RoadsideCoder 8 ай бұрын
I appreciate that!
@makingeliteinfotech5305
@makingeliteinfotech5305 Жыл бұрын
Thank piyush , I recommend your videos to everyone
@abdelrahmanelsaadany892
@abdelrahmanelsaadany892 2 жыл бұрын
I didn't know this video existed! Thanks bro! Really grateful.
@DeepakSingh-eq8jl
@DeepakSingh-eq8jl 2 жыл бұрын
Yes, please make some more lectures on interview questions including session and local storage
@shakeelahmed-wv8oh
@shakeelahmed-wv8oh 5 ай бұрын
Can u explain more for the question at 26:03, it will be more helpful for people who are not able to understand the concept of referencing and return statement
@ambesapaulos4323
@ambesapaulos4323 2 жыл бұрын
the way you teach is wonderful keep it up
@juniorWeb247
@juniorWeb247 Жыл бұрын
Really really help to me, thank you much brother. You are really doing a good job. God bless you, man.
@srinivasak4087
@srinivasak4087 Жыл бұрын
nice clear explanation , Thanks Sir!
@k.ksharma4457
@k.ksharma4457 2 жыл бұрын
great explanation as always u do 👍 and yes ye dil mange more 😀 so plz post a video based on local storage cookies and sessions deeply
@malag6358
@malag6358 3 ай бұрын
Thank You Soo Much I learnt Many Things
@avinashverma5538
@avinashverma5538 2 жыл бұрын
awesome video, helps a lot to clear concepts about objects. Thanks
@ajithk.s7848
@ajithk.s7848 2 жыл бұрын
Good and specific content.. 👌
@sanjaytk
@sanjaytk 4 ай бұрын
Road side paani-puri always awesome like Road side Coding... 🤟🤟😃😃
@hamid.mahmood96
@hamid.mahmood96 2 жыл бұрын
Yes please make a video on local storage and session storage
@asmitabiswas442
@asmitabiswas442 6 ай бұрын
For me you are the live saver
@abhishekkerketta9722
@abhishekkerketta9722 2 жыл бұрын
Please make a series of output based....It would really be very helpful.....
@karthikkonathala3002
@karthikkonathala3002 2 жыл бұрын
Yes, please make a video on differences between session storage, local storage and cookies when and how to use them
@tarak_80
@tarak_80 2 ай бұрын
I think structuredclone is one of the best way to get a deep copy of an existing object because it will also clone if there is nested objects .
@ansarisuhail5127
@ansarisuhail5127 8 ай бұрын
Such a great video🎉
@deepakkolare
@deepakkolare 2 жыл бұрын
Great explanation! Object.freeze and Object.seal could have been added to the video.
@nishachapte7
@nishachapte7 2 жыл бұрын
Thanks..Amazing and very useful video.
@subhramukherjee6990
@subhramukherjee6990 2 жыл бұрын
Good questions with great explanation.
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Thanks a lot!
@BrijeshSingh-dp1ku
@BrijeshSingh-dp1ku 2 жыл бұрын
Please make video on local storage, session storage and cookies ... It will be great help 🙏
@ShubhamPatil-rr4on
@ShubhamPatil-rr4on 2 жыл бұрын
Read it.....👉 Most welcome brother,lot of people watching you , yesterday I watched technical suneja live and thaire one of the people tell to Ajay sir that's I'm watching roadside coder js videos.and Ajay sir also appreciate it.💯♥️👍 Keep it up
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Oh wow bro, can u provide me the timestamp of that video where he said that?
@BrijeshSingh-dp1ku
@BrijeshSingh-dp1ku 2 жыл бұрын
@@RoadsideCoder 32.25
@ShubhamPatil-rr4on
@ShubhamPatil-rr4on 2 жыл бұрын
32:25 Yesterday I shared you timestamp but I don't know how it will didn't upload. Can we connect on LinkedIn I have some few queries if you help me out it will lot toe.
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
@@ShubhamPatil-rr4on Sure
@trendingindia972
@trendingindia972 2 жыл бұрын
Excellent video as always brother thank you
@kanchanmatai4170
@kanchanmatai4170 8 ай бұрын
Very nicely explained about json.parse and json.stringify with their use case. Please make more such videos on intserview questions based on output and coding.
@floatingcloud5955
@floatingcloud5955 2 жыл бұрын
2:27 fe = function expression You can assign a function() without 'function name' to a variable as value is called Function expression var a= function (){ }
@yaduvanshiNK
@yaduvanshiNK Жыл бұрын
An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.
@prabhneetsingh13
@prabhneetsingh13 2 жыл бұрын
This was such a great video, it cleared so many small small concepts of mine
@RahulKumar-ew1qw
@RahulKumar-ew1qw 2 жыл бұрын
Please make vdo on local storages, session, cookies And cache too.. Thanks you bro in advance.
@smordefx7688
@smordefx7688 2 жыл бұрын
works great and without any problems
@100bi8
@100bi8 Жыл бұрын
ThankYou Prabhu ❤❤
@kumar_awadhesh
@kumar_awadhesh 2 жыл бұрын
Good job 👍👍 Thank you
@pratikwadekar4981
@pratikwadekar4981 2 жыл бұрын
JSON.stringify and JSON.parse will only work on JSON safe objects. If the objects contain functions, symbols or dates that won’t create a deep clone
@instinct_gallant8694
@instinct_gallant8694 2 жыл бұрын
TNice tutorials tutorial was worth it, I understood everytNice tutorialng now
@svanaja331
@svanaja331 5 ай бұрын
Doing great job
@karthikeyasoft
@karthikeyasoft Жыл бұрын
I have little bit confusion over changeAgeAndReference topic time 25:50 personObj1 how come age : 25
@emilyaung2963
@emilyaung2963 2 жыл бұрын
Hey wouldn't Object.assign({} , user) and the spread operator do shallow copy? vs the JSON.stringify and parse will do deep copy?
@deepakkolare
@deepakkolare 2 жыл бұрын
Object.assign and spread are shallow copy for nested object for direct properties it’s a deep copy.
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Yes I've mentioned that this doesn't work for nested properties.
@abhishekvishwakarma9045
@abhishekvishwakarma9045 2 жыл бұрын
Nice Explanation 🔥
@ComonManYT
@ComonManYT 2 жыл бұрын
This video was so life changing, keep up the good work
@santhoshburgula6952
@santhoshburgula6952 2 жыл бұрын
Bro, I have gone through some videos, you are simply rocking and just you inspired me a lot. what should I do to pro in javascript like you ? is there any best book for javascript and as well as practice problems? please refer to any suggestions and root map. by the by, im from Non-IT background.
@rajathmr4171
@rajathmr4171 6 ай бұрын
Hey I was watching this tutorial for interview prep, got one doubt this cloning objects with different ways have its own limitiation. Most common is method is not preserved and also complex entities like Set, Map, Regex. loadhash would simpilfy this but how we can do this without using external library is there any Polyfills to it?
@ShreyaskarART
@ShreyaskarART 3 ай бұрын
Quite helpful !
@kitchen-e-kausar9105
@kitchen-e-kausar9105 Жыл бұрын
Great video, thank you. For the last question I'm confused, Object.assign and spread operator, do they really create a deep copy? Would have been great if the video ended with the sone nested object examples.
@lucaliebenberg7565
@lucaliebenberg7565 Жыл бұрын
Great video Piyush 💯 would you be able to please do a video on interview questions related to local storage, sessions and cookies?
@vipin3982
@vipin3982 2 жыл бұрын
Bro!!!!!!!!!!!!!!!Awesome Video
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Thanks!!
@osamajune9
@osamajune9 2 жыл бұрын
You are great ❤
@tamilselvans147
@tamilselvans147 2 жыл бұрын
Hi bro, nice session. Pls do a video for How to make api's very secure?.. what are the possibilities? Jwt, Refresh token, etc
@ajmalansari3165
@ajmalansari3165 7 ай бұрын
Yes make a video on local storage, session storage and cookies etc.
@himanshupandey3451
@himanshupandey3451 2 жыл бұрын
great big fan now
@cloud9656
@cloud9656 Жыл бұрын
Please create more videos for this playlist. Thanks
@sagarpatel8853
@sagarpatel8853 3 ай бұрын
Great job.but Object.assign, stringifying then parsing and spreading are not the correct way to create a deep copy of an object. because out of these three methods some are not compatible for nested objects and some are not compatible for functions and Dates inside the objects. In order to create a deep copy of an object we gotta install a third party library called lodash, which has got a functionality Clonedeep, which can help us in this.
@princeverma6533
@princeverma6533 2 жыл бұрын
Great Video, Please make video on cookie, session and local storage with examples
@Krishnasaini
@Krishnasaini 2 жыл бұрын
Where to practice more about these topics?
@abcxyz5385
@abcxyz5385 Жыл бұрын
Sir, please make video on session storage and local storage
@rahulrathod8959
@rahulrathod8959 2 жыл бұрын
Hi. But we can't reassign to a constant variable. As personObj1 is constant variable then why it is able to reassign in the function changeAgeandName?
@amanmalhotra8730
@amanmalhotra8730 11 ай бұрын
awesome ❤❤
@chirag8250
@chirag8250 2 жыл бұрын
13:35 yes please!
@kartik7775
@kartik7775 2 жыл бұрын
awesome videos, thank you!!!!!
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Welcome!
@avinash15sharma
@avinash15sharma 2 жыл бұрын
How we can compare two objects with same key-value pair but in different order? Also we are not allowed to use Lodash. Only Javascript solution.
@sanamukhtar4008
@sanamukhtar4008 7 ай бұрын
thank you
@sidd_shaikh
@sidd_shaikh Жыл бұрын
Hello sir if the object is deeply nested then how can we make deep copy
@salmanSyntax
@salmanSyntax 2 жыл бұрын
waiting 🔥
@SamruddhaShah
@SamruddhaShah 2 жыл бұрын
Why don't invinite amazon frontend engineeer for interview experience, we will learn alot
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Good idea
@cb559
@cb559 2 жыл бұрын
on timestamp 18.10 we are not renaming the value of name , we are assigning the value of name to myName .As renaming means changing the value of name to other string Please correct me if i am wrong
@divyasampath2843
@divyasampath2843 Жыл бұрын
I did not get this part, if someone can help: Since we are assigning obj1 to obj2, ideally whatever is the value is set to obj1 should be the same for obj2, right? as in, for both, the name should by 'pi', and age 7, isnt it? function change(obj) { obj.name = 'pi', obj = { name: 'hena', age:9, } return obj; } var obj1 = { name: 'div', age: 7, } const obj2 = change(obj1); console.log(obj1); console.log(obj2);
@user121304
@user121304 Жыл бұрын
Hi Piyush, Thank you for this wonderful series. Please make a tutorial on LocalStorage, Session storage and cookies. Will appreciate it. Thanks!!!
@rakaa31
@rakaa31 2 жыл бұрын
please make a video on How much javascript is enough for interviews and what are the important topics to focus on for interviews
@salonipande6190
@salonipande6190 2 жыл бұрын
Yes please make video on localstorage n session n cookies
@rohitahuja999
@rohitahuja999 2 жыл бұрын
why don't you use node js and run js code in terminal
@shubhambhardwaj1019
@shubhambhardwaj1019 2 жыл бұрын
Explanation 👌
@pavithrasai1392
@pavithrasai1392 2 жыл бұрын
can you explain about cyclic structures and why we cannot apply json.stringify on them?
@bandaumamahesh9346
@bandaumamahesh9346 10 ай бұрын
Bro can you please tell me some good books for javascript and react.
@rams9169
@rams9169 2 жыл бұрын
Hi all... i have small doubt for the below object...how to find key and value both ("second " : 2) in the below object..please i need your solutions const iem = { "first" : new Date(), "second" : 2, "third" : "test" }
@SamruddhaShah
@SamruddhaShah 2 жыл бұрын
Learn alot
@VishalSharma-rn7mt
@VishalSharma-rn7mt Жыл бұрын
Awesome
@ayushrastogi_
@ayushrastogi_ Жыл бұрын
Please create a video on interview questions asked about Local Storage and Sessions Storage.
@jaydadhaniya2209
@jaydadhaniya2209 11 ай бұрын
Object.assign will create shallow copy not the deep copy if we have nested objects please kindly note this
@JohnSnow-gi7iv
@JohnSnow-gi7iv 2 жыл бұрын
Is a career in frontend a good long term option? I feel a career in full stack or backend is better in long term? Your opinion will be helpful on this.
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Yes ofcourse it is! Why would you think that?
@HimanshuSharma-mx7yx
@HimanshuSharma-mx7yx Жыл бұрын
Make a video on the loacal Storage, cookies and session storage
@keshavgaur1886
@keshavgaur1886 2 жыл бұрын
I have been asked about how to print keys i was knowing the concept of foreign loop but don't know what happened during the interview was not able to tell that
@saikatbose2410
@saikatbose2410 2 жыл бұрын
Please make the video on local storage, session storage, cache and cookies etc
@MrK-nb7xr
@MrK-nb7xr 2 жыл бұрын
Please make on cookies , local storage, session related stuff every things .. Thanks
@shivambln
@shivambln Жыл бұрын
Great but some object methods are missing ..... Like freeze and all
@SachinKumar-bb2yn
@SachinKumar-bb2yn 2 жыл бұрын
Please make video on local storage
@ojaspalorkar7434
@ojaspalorkar7434 Жыл бұрын
Please make video on local storage session storage !!
@hareshdhanani2073
@hareshdhanani2073 2 жыл бұрын
Thanks.
@vijenderkumar3034
@vijenderkumar3034 Жыл бұрын
Please make video on local and session storage and cookie
@20TUEC012ATHILAKSHMI.M
@20TUEC012ATHILAKSHMI.M 8 ай бұрын
kindly make video on localStorage session
@shahzoobgouhar2334
@shahzoobgouhar2334 Жыл бұрын
Fellow devs below is a Polyfill for deep copy function deepCopy(obj) { if (typeof obj !== 'object' || obj === null) { return obj; } var copy; if (Array.isArray(obj)) { copy = []; } else { copy = {}; } for(key in obj) { copy[key] = deepCopy(obj[key]) } return copy; }
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Solving Uber Frontend Interview Question | Interactive Shape
26:11
Devtools Tech
Рет қаралды 53 М.