Want to thank you 😊 .. got selected at Paytm ( ur js interview questions helped a lot)
@codestop8111
2 жыл бұрын
Bro aur kuch batao kaise apply kiya kya poocha gya kitna experience tha aur package bgera if you are comfortable
@pratyushpraveen3486
2 жыл бұрын
Is Paytm a good option in the current situation? have my last round tomorrow but am a bit skeptical about should I proceed or not.
@narendrareddyyarramreddy2007
2 жыл бұрын
guys did you attend for DSA rounds too?
@RoadsideCoder
2 жыл бұрын
Wow dude, congratulations! Message me on instagram @RoadsideCoder. I'd love to know more
@aw0yw2wh-pm8sl
Жыл бұрын
This guy is roadside coder video editor😂😂
@ankittyagi1178
2 жыл бұрын
the last question can be done only using reduce Because when we chain multiple operators we increase the complexity. Thanks for the video, learned alot. let output =students.reduce((acc,curr,i,arr)=>{ if(curr.marks60 ){ acc=acc+curr.marks } return acc; },0) console.log(output);
@shash0_0
5 ай бұрын
Not completely true. The complexity would still be in the range of O(n). I do agree that it will 'increase', say, by a factor of k times n but it would still be linear. In real codebases, you prefer readability over over-optimizations.
@shash0_0
5 ай бұрын
Here's a more readable approach- const totalMarks = students .map(x => { if (x.marks < 60) x.marks = x.marks + 20; return x; }) .reduce((acc, curr) => { if (curr.marks > 60) return acc + curr.marks; return acc; }, 0); console.log(totalMarks); Once catch which is similar to your approach is that it modifies the original array
@somnathnavale9283
2 жыл бұрын
hey, this polyfill for reduce is not giving correct result when we have to find sum of square of array items. for that we gave initial value as 0 ,so in for loop when we are checking accumulator has value or not it takes zero is false value assigned the value of first index instead of square of it. to removed this Error we have to refactor our ternary operator checking by accumulator=(accumulator===undefined)?this[i] : cb(accumulator,this[i],i,this); so when initial value is given as zero that time it will not take this as falsy value and call the callback function instead assigning first index value.
@swaroop040
2 ай бұрын
can you please tell what can be the output of the following code function sample(){ console.log(x) console.log(y) } var x = 10; let y = 11; sample(); and also explain
@yugandhargoud4124
Ай бұрын
the output will be 10,11. Initially variables and function are stored in memory component of execution context. in code run phase once it reaches function call it access the global variables such as x and v and logs them to the console.
@GauravKumar-ue7nz
Жыл бұрын
Thank you For This. PS: In last question, Inside map you modified the original students.
@kanchanmatai4170
5 ай бұрын
very nicely explained the concepts with exercises....awesome!!!!keep sharing such content!!
@RoadsideCoder
5 ай бұрын
Thanks, You can find full course here - roadsidecoder.com/course-details
@mohammedashraf8351
2 жыл бұрын
you could use "quokka extension" to log the values in vs code itself
@arpithiside
Жыл бұрын
Another solution to the last problem: const op = users.filter((user) => (user.marks + 20) > 60).reduce((acc, user) => acc + user.marks, 0); 😀😀
@AbhishekBhandari-m7v
Жыл бұрын
Better solution for last Question : - const result = students .map((stud) => (stud.mark < 60 ? { ...stud, mark: stud.mark + 20 } : stud)) .reduce( (accu, curStudent) => curStudent.mark > 60 ? accu + curStudent.mark : accu, 0 ); Reason why is this solution better : - 1st reason : you save using Filter method means more optimized . 2nd reason : The solution provided in video at 24:32 , he mutates the stu.mark += 20 which in result also mutates the original array(students) which is bad practice.
Hi, Piyush, first of all, thank you so much for this video, I'm just following every video.. I've one doubt, I copied exact code for reduce function polyfill,..... "return acc * curr" (Multiply) is not working if I put initialValue as 0, if I dont put it, its working.. in original reduce function its working. Not sure why, I'm not getting.. Can you please suggest where should I do any changes or look into to fix this. Please. :(
@VimalKumar-ts7xn
Жыл бұрын
i see on issue in the reduce method polyfill that if we send 0 as the initial value, this implementation breaks due to nullish coalescing since it takes 0 as a falsy value so we can update the check like acc = acc || acc== 0 ? cd(params): this[index]
@surjoyday_kt100
7 ай бұрын
Array.prototype.myReduce = function (cb, initialValue) { let acc = initialValue != undefined ? initialValue : this[0]; for (let i = 0; i < this.length; i++) { acc = cb(acc, this[i], i, this); } return acc; }; Brother even i had the same thought, you can try this i think this will solve the issue of initial value as 0. And thank you very much for the insightful interview questions @RoadsideCoder. They are incredibly helpful in preparing me for future opportunities.
@tankaido2885
Жыл бұрын
U're so funny and Ur teaching is so wonderful...I think u're among the best..No i don't think,i'm sure...
@shujathaliirfan2662
2 жыл бұрын
Super bro fantastic ....
@pearldanish7245
Жыл бұрын
I think the best content on javascript ever on KZitem because you just don't teach theory but also the potential questions to be asked related to them. Please complete this interview playlist of javascript and don't stop making videos . Waiting for your prototype and inheritance video
@jalluchakri1528
Ай бұрын
Hey ! Thanks for explaining so nice and marveless
@YourTechWhiz
2 жыл бұрын
Why did you use Var( instead of Let ) in Reduce polyfill ? Var accumulator = initialValue;
@happyhumai
Жыл бұрын
same ques
@arundhathimenon8168
2 жыл бұрын
your all videos are Praiseworthy💯. I Improved a lot after watching your tutorials 😍.. tons of thanks and respect🙏
@RoadsideCoder
2 жыл бұрын
Wow, Great to hear that!
@ankushladani496
2 жыл бұрын
BHAIYA PLZZ INCREASE VIDEO FREQUENCY AND ALSO CAN YOU HELP ME TO GET AN INTERNSHIP AS FRONT END DEVELOPER?
@susmitobhattacharyya1668
Жыл бұрын
You are the most underrated JS content creator. Thanks for your awesome contents!
@jonecir
3 ай бұрын
Hello, you did a very good job posting these JS interview questions!
@chhavimanichoubey9437
Жыл бұрын
Array.prototype.myReduce = function (cb, initialValue) { var accumulator = initialValue; for (var i = 0; i < this.length; i++) { if (accumulator !== undefined) { accumulator = cb(accumulator, this[i], i, this); } else { accumulator = this[i]; } } return accumulator; }; SOURCE: MEDIUM
@kotireddy9460
Жыл бұрын
For reduce polyfill, we should only check if accumulator is undefined when i=0. We should not use ? To check undefined. See the output by giving [-1, 1, 2, 3]
@chhavimanichoubey9437
Жыл бұрын
Array.prototype.myReduce = function (cb, initialValue) { var accumulator = initialValue; for (var i = 0; i < this.length; i++) { if (accumulator !== undefined) { accumulator = cb(accumulator, this[i], i, this); } else { accumulator = this[i]; } } return accumulator; };
@nagalokgames8861
Жыл бұрын
@@chhavimanichoubey9437 your solution will not work if we pass undefined as accumulator
@durgeshgupta6647
6 ай бұрын
hi, just one correction for the polyfill of reduce method...in ternary operator we are providing initial value as 0 but still else part will be executed because 0 is a falsy value.please correc it...thanks
@RoadsideCoder
6 ай бұрын
Wont make a difference
@shashanksshetty9870
2 жыл бұрын
Good concept. Liked the way you broke down problem and showed approach to resolve it. Also, there is one more difference between forEach and map. If element is undefined then map will skip that iteration where as forEach won’t skip that. I found this issue when I ran new Array(3).map(cb) here map function didn’t work at all. That’s where I came across this issue. PS: fix for above issue is const res = new Array(3).fill(1).map(cb) 👻
@tusharrai3644
2 жыл бұрын
This is not an issue, it just creates an empty array so map doesn't iterate over empty array.
@tusharrai3644
2 жыл бұрын
Think of it as let arr = [] arr.length = 3
@shashanksshetty9870
2 жыл бұрын
arr.length is a hacky solution, I don't recommend it. Those are called sparce array(not sure of names). Basically all the HOC functions which are introduced for array prototypes avoid this type. Since they consider this as bad data formatting. I don't remember the exact source of this topic. You can give it a shot in MDN docs.
@theempire392
10 ай бұрын
in custom reduce function we can simply add default value to initialValue, it's cleaner and more understantable Great content though! Array.prototype.myReducer = function(callback, initialValue = this[0]) { let result = initialValue; for(let i = 0; i < this.length; i++) { result = callback(result, this[i], i, this) } return result }
@abahiduh3246
Жыл бұрын
You have made great videos but what made what u are explaining to be like magic is ur UNDERSTANDING of JAVASCRIPT LOGIC. NON of the videos on KZitem explain LOGIC OF SYNTAX. No learner would understand POLYfill with understanding JS SYNTAX LOGIC
@AkhilendreRawat
Ай бұрын
Great video! Just that reduce prototype should not be checked against accumulator to assign initial value, instead should be checked for accumulator value being undefined or not . So that if you do console.log([0,2,3].myReduce((acc,curr)=>{return acc*curr},0)); you will get 0 not 6.
@front-end-world
6 ай бұрын
Final qn one other approach: const result = students.reduce((acc,current)=>{ let sum = (current.mark =60){ acc = acc + sum; } return acc; },0) console.log(result)
@sakshamsrivastava6280
Жыл бұрын
why are we pushing the callback into the temp array can you please explain, why could not we just push this[index], instead we push callback?
@DemystifyFrontend
Жыл бұрын
so this inside the filter method points to the original array and the filter should return a new array which is temp in our case
Bro your interview questions are very good, but please provide source code also it will be very helpful for us .
@RoadsideCoder
3 ай бұрын
All the source code here - roadsidecoder.com/course-details
@kalukalu6627
3 ай бұрын
Awesome video, thank you for sharing your expertise on map, filter, and reduce polyfills. The explanations and examples were very clear and helpful. I appreciate the effort you put into creating such a valuable resource for JavaScript interview preparation. Keep up the great work!
@ajayjaykar7833
4 ай бұрын
# Hi, If I follow this series only then am I ready for an interview as frontend dev? I'm a fresher..
@RoadsideCoder
4 ай бұрын
Yes, for js interviews
@serial_coder
11 ай бұрын
16:9 This works for both map and forEach so that is not actually a difference.
@gauravgol2211
3 ай бұрын
Thankyou sir
@gauravgol2211
3 ай бұрын
Thankyou sir
@AmOsVisualRealities
2 жыл бұрын
Make video on interview question on css. Basics
@RoadsideCoder
2 жыл бұрын
Sure!
@aryansihag
2 ай бұрын
hindi
@kunalsolanki597
2 ай бұрын
Yes bjri😊
@shiranjeeth4020
2 жыл бұрын
Bro in 20.42 u said only one student has rollnumber more than 15 but 2 of them are more than 15 u have used && operator and it gives only one student result
@Lucifer-xt7un
2 жыл бұрын
Please make these video series regularly bro 🥺 🥺
@RoadsideCoder
2 жыл бұрын
Trying my best, Unable to get time due to job 😕
@randomsVlogs871
2 жыл бұрын
Love you from Pakistan 🇵🇰 I got a remote job in the US your videos helped me a lot
@AshishGupta-be2yz
Жыл бұрын
Nice content bro...thanx a lot very helpful for interviews.
@zhumabayevorymbek2548
5 ай бұрын
Thanks for such good explanation!
@RahulKumar-ew1qw
2 жыл бұрын
U are making me stronger than my past. Love u brother..
@RoadsideCoder
2 жыл бұрын
🙏❤️
@A1996ARP2075
2 жыл бұрын
Great please keep uploading regularly
@RoadsideCoder
2 жыл бұрын
Trying my best, Unable to get time due to job 😕
@chhavimanichoubey9437
Жыл бұрын
when we dont give any initial value for reduce in last task, it will take whole object as initial value right? so we need to give initial value?
@RoadsideCoder
Жыл бұрын
it will take 1st element of array as an initial value
@chhavimanichoubey9437
Жыл бұрын
@@RoadsideCoder but then we have to do something like this acc.marks right?
@josedevelop
2 жыл бұрын
I called the reduce polifill in students object but it seems like initial value parameter is not configured and doesn't work
@kathirmldata7411
2 жыл бұрын
hey dude.first of all thanks for the all videos. i have just learned your redux concept video. your way of teaching is awesome. and one more thing please wear small size eyeglass
@ranitasaha8708
2 жыл бұрын
Firstly thank you for making these kinds of videos. These videos are super helpful.😍 And what kind of questions do interviewers ask in React? Please make a video of this. Also, Having problems in implementing useReducer. Please refer to some good resources☹
@RoadsideCoder
2 жыл бұрын
Glad you liked it! Also for useReducer, you can watch my shopping cart video on my channel.
@rahularora9153
Жыл бұрын
Excellent video, however last problem statement seemed fine to be executed via a single reduce function :) let students = [ {name:"a", marks:80}, {name:"b", marks:69}, {name:"a", marks:35}, {name:"a", marks:55}, ] const arr = students.reduce((acc,curr)=>{ if(curr.marks>60) return acc + curr.marks; else if(curr.marks+20>60) return acc + curr.marks+20; else return acc; },0) console.log(arr);
@bhupendersoni5467
Жыл бұрын
It can be more simpler. students.reduce((acc,curr,i)=>{ let val = curr.marks
@RavindraSingh-lp9pl
10 ай бұрын
@Roadside Coder PR review and code changes kaise krte he please make detailed video on that
@RoadsideCoder
10 ай бұрын
ok i will
@RavindraSingh-lp9pl
10 ай бұрын
@@RoadsideCoder thankss bro..please make asap as I am giving interviews..big thanks for your reluctant efforts 🎉🍷🍷
@niklausmikaelson7332
2 жыл бұрын
Bro in redux reducer get actions from dispatch function?
@PrasenjitDas-ju8ol
2 жыл бұрын
Please make a video for Array.flat() prototype
@shubhamsatpathy6489
2 жыл бұрын
Would you make a video on nested json . Like Filtering nested json array .
@soni.himansh
2 жыл бұрын
What all vscode extension do u use , I like the one u use of auto spacing or identation. Which one is that?
@ShivamMishra-mn6cs
2 жыл бұрын
Pls make a video on react location and react query any time soon
@akashKumar-dv9xk
Жыл бұрын
Make a pdf of this questions and answers
@ankushladani496
2 жыл бұрын
Maja aagaya bhaiya thank you...
@RoadsideCoder
2 жыл бұрын
Awesome
@pawanchhangani7528
2 жыл бұрын
Thanks a lot bro for your guidance, with your support I cracked React Js Frontend interview as a frasher.
@RoadsideCoder
2 жыл бұрын
Wow congratulations!
@amanjain6067
2 жыл бұрын
What extensions in VSCode are best for day to day UI coding?
@shahzaib715
9 ай бұрын
Bhai, I just want to ask whether they inquire about (DSA) or (OOP) during front-end or MERN-Stack interviews.
@RoadsideCoder
9 ай бұрын
both
@shahzaib715
9 ай бұрын
@@RoadsideCoder dsa and oop just like cpp??
@darjipavan5112
2 жыл бұрын
Sir , please tickets booking system ka project banaiye MERN Stack me I personally request you sir please
@RoadsideCoder
2 жыл бұрын
Sure
@avneetkaur2731
8 ай бұрын
your javascript knowledge is really great! can you make a video on topics like event loop and prototypal inheritance as well.
@RoadsideCoder
8 ай бұрын
Thanks Avneet!
@kalpeshwani231
2 жыл бұрын
Please start the e-commerce series with Geo location api to filters the nearest shops
@fabricator.cap.hill.seattle
2 жыл бұрын
This was a really great video, thanks!
@kamleshsukhwal5861
Жыл бұрын
go slow , reading book or what
@technicalesson
2 жыл бұрын
Hey i am curious to know the logic behind your channel name 'roadsidecoder'. How the idea came in your mind to take the name roadsidecoder also want to know the meaning of this?
@RoadsideCoder
2 жыл бұрын
Haha, is there something wrong with it?
@atulpatil2289
2 жыл бұрын
keep coming these valuable videos
@fazilhakkim1091
Жыл бұрын
thanks for helping to understand the concept brother
@jiteshtechbeast
2 жыл бұрын
Here is the notes :- Github Link:-github.com/jk872001/JavaScript-Concepts/tree/main/RoadsideCoderPlalist Feel free to follow me on github
@hardikdhamija-x1s
Жыл бұрын
where is video on protypes?
@ProgrammingWithProject
2 жыл бұрын
Sir please make a video on prototype prototyipal inheritance
@RoadsideCoder
2 жыл бұрын
Definitely
@ragupathy1000
2 жыл бұрын
Map filter find reduce
@BeymOsman_edits
Жыл бұрын
You are doing well ❤❤
@vincent3542
Жыл бұрын
nice video, lot of insights for me (work exp under 2 years)
@RoadsideCoder
Жыл бұрын
Great to hear!
@shash0_0
5 ай бұрын
Helped a lot. Thanks!
@hamzashaikh6695
2 жыл бұрын
Awesome content bro 🤜...
@adithya_aravindan8903
2 жыл бұрын
thank you bro thank you
@lovishduggal9064
5 ай бұрын
Thanks!!
@AzadTamal
2 жыл бұрын
💚🧡
@Rajkaushik-e3z
Жыл бұрын
Will this reduce polyfill work for cases like: initialValue = 0 and callback = (acc, curr, i, arr ) => return acc * curr
@Rajkaushik-e3z
Жыл бұрын
We might have to check whether the acc is actually passed or not i.e. checking if it is undefined or not
@RoadsideCoder
Жыл бұрын
Obviously it will!
@swatinalwade972
2 жыл бұрын
Thank you sir.. please cover callback and promise in Javascript .
@RoadsideCoder
2 жыл бұрын
Sure
@PratikP-j1f
9 ай бұрын
graat I like it
@prashantnath2747
2 жыл бұрын
please keep up the good work!!! ur doing awesome ♥
@A9kit.k
2 жыл бұрын
Yes sure, plz add more videos like this. Thank you
@DS-zr9gv
Жыл бұрын
Thanks for this 💚
@mohammedfaseeullah6095
Жыл бұрын
Awesome learning from you🎉
@reeganthomas44
Жыл бұрын
Thank you 🙂👍
@prashlovessamosa
Жыл бұрын
I was confused in this topic this video is life saver thanks.
@LifeStoryAshita
2 жыл бұрын
Completed ✅
@purusharma8192
2 жыл бұрын
After following you on twitter,i get 100% hike,it works
@RoadsideCoder
2 жыл бұрын
I knew it works 😁
@gauravchaudhari8874
2 жыл бұрын
Very helpful👍🏻
@ravishbisht502
10 ай бұрын
Its really amazing sir
@mohitmandhre8614
2 жыл бұрын
Awesome content bro 🤜... Which documentation you refer to for preparing ur content? Can you suggest one?
@RoadsideCoder
2 жыл бұрын
MDN Docs
@cezardmc
Жыл бұрын
Thank you 🎉
@mubashirbashir4753
Жыл бұрын
Your video has made these confusing concepts much clearer. Thanks Alot man!
Пікірлер: 157