Javascript Interview Questions and Answers - Dominate Your Next Interview

  Рет қаралды 71,496

Monsterlessons Academy

Monsterlessons Academy

Күн бұрын

Пікірлер: 194
@reactivicky
@reactivicky Жыл бұрын
Thank you. I got asked few questions in interview and I answered them confidently thanks to this video. Love from India :)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Awesome!
@mohammadyousuf1567
@mohammadyousuf1567 Жыл бұрын
great quality and profound content for those who are preparing for JS interview. Thank you saviour
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad it was helpful!
@renzaldwinbarnedo4779
@renzaldwinbarnedo4779 2 жыл бұрын
51:00 return expression should be >=0 to accommodate item with index 0
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
You are totally right!
@kashmirtechtv2948
@kashmirtechtv2948 2 ай бұрын
Awesome brother. Need more such videos... I didn't pay much attention to the Currying topic.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 ай бұрын
Glad you like it!
@joaovitorveronesevieira2633
@joaovitorveronesevieira2633 Жыл бұрын
At 51:10, you need to change your return code when using the findIndex function. If you test the name at position zero (arr[0]), it will return false because the index is 0 and your return says "index > 0". Changing it to "index >= 0" will fix it.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Sure. The whole course is already updated.
@easifier
@easifier Жыл бұрын
@@MonsterlessonsAcademy Hi, just to inform you that I still see it as "index > 0". btw thank you for the course and detailed explanation :)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
@@easifier Where do you see it. The course on the website and Udemy is updated. KZbin videos can't be updated.
@easifier
@easifier Жыл бұрын
@@MonsterlessonsAcademy here on KZbin. I thought you could add some text like subtitle to that second, but I'm not sure if its possible.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
@@easifier No it is not possible.
@dfghjkl5598
@dfghjkl5598 Жыл бұрын
This was fantastic! I learned so much 👍 Just so you know, when you pronounce 'undefined' in English. You don't pronounce the 'ned' part like the word 'red'. You instead pronounce it like 'find' so something like 'un-d-find'
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Thanks for the tips!
@NamNguyen-oz8uj
@NamNguyen-oz8uj 2 жыл бұрын
Im prepping for my internship interview, this is extremely helpful. Thank you very much 🙏🎉
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Best of luck!
@2slimj
@2slimj 2 жыл бұрын
The timing is perfect, I'm getting ready for an interview in few days time. Ive also watch your Coding interview task.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
You are welcome. There are 59 tasks in this course. They cover the whole Javascript knowledge.
@zoxx972
@zoxx972 Жыл бұрын
Always amazed by the quality of your videos. Straight to the point and very well explained. Thanks man !!! 👊
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Happy to hear that!
@pawanbhatt9329
@pawanbhatt9329 Жыл бұрын
ok@@MonsterlessonsAcademy
@pawanbhatt9329
@pawanbhatt9329 Жыл бұрын
ok
@pawanbhatt9329
@pawanbhatt9329 Жыл бұрын
ok
@ElderESG
@ElderESG 2 жыл бұрын
You provide one of the best information out there my friend. Keep it up !
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Glad you think so!
@devcaand
@devcaand Жыл бұрын
Difference between null and undefined is that you can get null only if you set it yourself and undefined is auto assigned by js to represent no value. I mean you can set undefined by yourself but that would be against the logic. You should never manually assign undefined to a variable, that's what is null for.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You are totally right. From experience I see a lot projects where people use either only undefined or only null. I prefer null so it looks like nil in other languages where there is no such thing as undefined.
@devcaand
@devcaand Жыл бұрын
@@MonsterlessonsAcademy Yes, but it's not just the matter of preference. If you look at someone's code that you are not familiar with and you see undefined, that shoud mean something is wrong. When you see null you understand that this has been set on purpuse, for whatever reason. But if you start using it as a preference, you loose that meaning. That is why there are two of them, it wasn't left there just for fun.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
@@devcaand I get your point but in all other languages you have just nil and not 2 things like null and undefined which is confusing in js. Additionally if you set undefined in redux in your state for example it is not shows at all which is also confusing when you want to see global state.
@shvideo1
@shvideo1 2 жыл бұрын
Fantastic crystal clear concepts. Love it. Thank you very much for this awesome content.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Glad you liked it!
@dirkpostma77
@dirkpostma77 6 күн бұрын
First one, I’d ask: can we be sure all items have an object with property name? If not, we should validate or use ‘user?.name’ And, I start with writing a test.
@spongebobsquarepants4576
@spongebobsquarepants4576 2 ай бұрын
A problem with the approach of chaining is that arrays are immutable in JavaScript. Meaning that when you call filter and then map you are creating 2 new arrays. This is a problem if you have a very big array as you double your complexity. A more efficient approach would be to use a for loop. In general, chaining higher functions is not a good idea for this reason
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 ай бұрын
It's not a problem. I prefer and recommend working without mutating data to make code less error prone and simplify scalability. We mostly don't work with big arrays this is why it's not a problem. Obviously if you optimize a huge array then you want the least amount of changes.
@hotguy5460
@hotguy5460 Жыл бұрын
hey, thanks a lot!!! You explaning really really good! I'm really thankful for that.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad to hear that!
@Kelz_369
@Kelz_369 8 ай бұрын
Thanks for the video, very informative. Just want to point out one thing at 13:50 where you mention that "there's no such type of null" when in fact null is a primitive type. The reason why the typeof logs it as an object is a known bug in JavaScript bug.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 8 ай бұрын
Good point!
@gypsicoder
@gypsicoder Жыл бұрын
Thank you for the nice video. This video will be so helpful for interview. But, I see one problem in the section "Check if user exists". It will be return index >= 0 not just index > 0.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Yes, you are right!
@ishanjain7288
@ishanjain7288 Жыл бұрын
Hey! Thanks for the explanation, and also for the tips at the end.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad it was helpful!
@das6109
@das6109 Жыл бұрын
Thank you for covering so much important info. That said I feel like JS devs are a different breed lol. It's crazy to me to hear people call stuff like 50:00 or 55:00 more readable than the most generic for loop structure that has existed in every language. In the later case you're chaining two arrow functions with two method calls one being reduce and then using a ternary to save like one line of code over a generic for loop. I've been trying to get used to these methods for a while, but is there genuinely anyone on this planet that finds that easier to parse than seeing a generic for loop that clearly iterates through an array with a conditional check? I get that it's 'easy to read' when you don't need to read it, like when it is working. But from the perspective of written once, read 20 times, is it actually easier to debug code made up of nested methods that take almost the same amount of code but put it flat rather than vertical? Would a bug be actually harder to find in a simple for loop structure? I'm asking for your industry perspective because it more just feels like a way to flex JS library familiarity by devs than anything that will likely improve readability. And it seems weirder still knowing the performance issues and limitations on short circuiting stuff like forEach imposes.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Depends on the language but code based on loops which is common in php or java is not easily supportable imho as you need more variables and nested loops even worse. As I'm a huge fan of functional code I can be biased here. Anyway it is better to know both approaches so you can write code in a way like your team or company wants.
@das6109
@das6109 Жыл бұрын
@@MonsterlessonsAcademy Thanks for your input. I'm trying to get used to both, but I definitely feel I can better parse the regular for loop. I feel with the block scoping of let, using variables as counters isn't such a big deal in js now. But I understand where you're coming from too. I just find the 'more readable' claim weird.
@nanananabatman7056
@nanananabatman7056 12 күн бұрын
@@das6109 loops can have a complexity which is very hard for the interpreter to optimize around. That is why usage of map functions is recommended. Maybe he meant that with easier to read as you don't have to worry about out of bound errors and undefined values as much. If I recall correctly, the array object functions have mostly catch errors, which make them easier to deal with.
@justcallmewalid4002
@justcallmewalid4002 Жыл бұрын
i've been watching your videos lately .. sub deserved
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Thank you!
@thebestchillsounds4780
@thebestchillsounds4780 Жыл бұрын
Excellent for junior frontend engineer :)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad to hear that!
@Asaloy
@Asaloy Жыл бұрын
8:40 I wouldn't use filter and then map, because it then has to loop over the array twice. I would prefer a simple if condition inside the map function.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
This is totally fine to show other way on the interview and why you prefer it.
@omergatenio6802
@omergatenio6802 Жыл бұрын
53:00 if i'm not mistaken, a faster way to solve this instead of using includes function is to use hash tables (storing array items in one object and check if their exists). It takes less time but add to the space complexity. please correct me if i'm worng, great video!
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Sure you can solve tasks differently.
@Shahid-fi3ts
@Shahid-fi3ts Жыл бұрын
19:52 Actually I believe const and let are hoisted as when you try to call a variable before you define it you get this error: "ReferenceError: Cannot access 'number' before initialization." Instead of the typical variable is not defined error. The difference is that the var variables are initialised (like you said to undefined) but the let and const variables are not initialised.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You are totally right!
@sfspmusic
@sfspmusic 5 ай бұрын
You have a JavaScript interview preparation course 2023, which is probably this course. I have several questions : 1) what is the length of this course 2) if I buy this course or the subscription to all the courses, what format do I get it in? Is it some KZbin playlist or some downloadable files? Thank you!
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 ай бұрын
This course is 3 hours 44 minutes long monsterlessons-academy.com/courses/javascript-interview-questions-coding-interview You get access to the videos on the website including downloadable files (as zip archive for each video) and ability to ask questions in comments under the video.
@cagri5886
@cagri5886 8 ай бұрын
Great video, great points. Liked and subscribed!
@MonsterlessonsAcademy
@MonsterlessonsAcademy 8 ай бұрын
Thanks for the sub!
@CuriousCattery
@CuriousCattery Жыл бұрын
This is excellent but there's a bug at 51:09 when you return index > 0 because the name could be at index 0.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You are totally right. The full course is updated accordingly.
@shubhamsoni6013
@shubhamsoni6013 Жыл бұрын
46:00 Spread Operator may fail with array of Object function Merge(arr1, arr2) { return [...arr1, ...arr2]; } const arr1 = [{ name: "Lorem" }]; const arr2 = [{ name: "Ipsum" }]; const arr3 = Merge(arr1, arr2); arr3[0].name = "LoremX"; console.log(arr1, arr3);
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You are totally right because it is related to nested copy so you get the same problem is with copying nested objects
@Sergei546
@Sergei546 Жыл бұрын
thank you for your videos!! i am watching them. it is very perfect! your russian accent is also fine
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad you like them!
@humzajameel5487
@humzajameel5487 Жыл бұрын
Amazing video, covered alot of necessary contents.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad you liked it!
@clintona1855
@clintona1855 Жыл бұрын
I like your teaching style, man.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad to hear that!
@johnacsyen
@johnacsyen 5 ай бұрын
@2:18, interview question = never used this knowledge in your everyday work. how true
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 ай бұрын
Life is pain
@erice.3892
@erice.3892 6 ай бұрын
this was great content, thank you! 👍🏼
@MonsterlessonsAcademy
@MonsterlessonsAcademy 6 ай бұрын
Glad you enjoyed it!
@hoshikuzuvenus
@hoshikuzuvenus Жыл бұрын
this dude an A.I. fr. but thanks for the great content!
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad you enjoy it!
@avertry9529
@avertry9529 2 жыл бұрын
My two cents... Put sort after filter to not mutate the original array, isn't this the preferred method? .sort((a, b) => b.age - a.age) looks a lot cleaner
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
you are correct because filter returns a copy. But if you don't need filter then you have a problem. Sure - will go with numbers.
@dmcs2003
@dmcs2003 Жыл бұрын
Interesting thing about Curry functions....I've been a professional software developer for 25 years and have not once written a curry function or utilized someone else's curry function. I keep seeing the "idea" being presented as if it was common, but wanted to see if I am not alone in my experience. Who here uses curries at work? If so, what type of work do you do?
@seymour_videos
@seymour_videos Жыл бұрын
We've got some modules built using currying.. I work as a backend dev
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Some teams use it but most not. It's a matter of preference. People with knowledge of haskell or similar functional languages have bigger chance of using it.
@dmcs2003
@dmcs2003 Жыл бұрын
@@seymour_videos Thanks, was there a reason to implement currying because calling the function directly was not available? Or did it make the code more maintainable and/or readable?
@seymour_videos
@seymour_videos Жыл бұрын
@@dmcs2003 there are a few benefits when it comes to error handling.. the functions are called with one param, and return a function that takes the next set of params.. and so on.. building a function in this manner ensure required variables are there.. example: We've got a multi-tenant system, depending on who the caller is the currying function is built differently resulting in different methods being available to the specific caller.. Similar to what "monster" said, its JS attempt at functional programming
@rahilsiddique6950
@rahilsiddique6950 Жыл бұрын
just today I discovered your channel and its amazing, keep the good work !!
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Welcome aboard!
@kin_1997
@kin_1997 2 ай бұрын
amazing video thank you
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 ай бұрын
Glad you liked it!
@chetanysharma_1
@chetanysharma_1 Жыл бұрын
console.log(counter().getValue()); counter().increment(); console.log(counter().getValue()); if we don't assign to privatecounter to any variable and use directly like that . increment is not work.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Yes of course. counter() call creates count again. You don't use it as a closure then.
@Erwin93200
@Erwin93200 7 ай бұрын
Quality content. Do you have information on the integers, floats and how its managed in js ? I had a question about this in an interview and i was stuck 😂😂
@MonsterlessonsAcademy
@MonsterlessonsAcademy 7 ай бұрын
Unfortunately, no
@doniaelfouly4142
@doniaelfouly4142 Жыл бұрын
this is a very usedul video, thank you so much
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You're very welcome!
@Aloncr7
@Aloncr7 Жыл бұрын
Top level video! At 50:15 instead of boolean I would use - return !!el;
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Sure
@omsunkoradji120
@omsunkoradji120 Жыл бұрын
where is Mike in the sorted array? (without filter and map)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
What code do you mean exactly?
@fveS
@fveS Жыл бұрын
55:40 I also use filter
@МаринаМарт-п7ф
@МаринаМарт-п7ф Жыл бұрын
Thanks for great content! Less code doesn't always mean better. For each loop is slower than for loop for example. If there are a lot of elements in the array it is better to use for loop (if for some reasons we can't use ES6)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
I agree. But until some point readability is more important than performance. Obviously in the feature to do something with 10k elements it is better to use plain for loop.
@andreineculaesei2394
@andreineculaesei2394 Жыл бұрын
​@@MonsterlessonsAcademy There's no readability increase by using forEach. It's subjectively slower and less readable than 'for (item of array)'. Videos like this is why there's so much misunderstanding and forEach usage.
@humzajameel5487
@humzajameel5487 Жыл бұрын
@@andreineculaesei2394 well syntax wise it is better readable, but definitely traditional loop has a lot of advantages over forEach, like one can't break the loop during the execution in forEach. The performance difference is really necessary to consider. But here he is just giving examples of solving some quick interview questions but one must definitely be aware when to use which loop. for demonstrating an example with just three to five elements it won't be an issue to use forEach.
@PDMGyanStudy
@PDMGyanStudy Жыл бұрын
great Explanation🥰🥰🥰🥰
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Thank you! 😃
@PDMGyanStudy
@PDMGyanStudy Жыл бұрын
please make a video on React js interview@@MonsterlessonsAcademy
@mazthespaz1
@mazthespaz1 Жыл бұрын
with large data sets, the filter then map has terrible time complexity and there is nothing wrong with the if test on active. what you are calling low-level is also easily portable to other languages with very little work.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You are totally right but in 99% of the cases we care about readability and we don't have large data sets on the client. In 1% loops are better. And realistically nobody cares if it is portable to other languages or not because nobody ports js somewhere.
@nanananabatman7056
@nanananabatman7056 12 күн бұрын
Weird I never had such easy questions in my interviews, most of the time they asked a lot about complexity and how I would write my own sort or filter method. I had to write a binary search and a heap-sort on paper
@MonsterlessonsAcademy
@MonsterlessonsAcademy 12 күн бұрын
I understand that a lot of people try to get any job and start working but if for a web developer you need to write a binary search or your own filter you should ask how often they do that in production project. Because it's not a part of everyday work.
@nanananabatman7056
@nanananabatman7056 10 күн бұрын
@@MonsterlessonsAcademy i know it's not, it rarely is . Most of the time they copy a easy or medium question from leetcode and the complexity of the more common algorithms
@Sagarclips
@Sagarclips 2 жыл бұрын
Well done 👏
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Thank you 😁
@rafeifabulihya2814
@rafeifabulihya2814 Жыл бұрын
شكرا ❤
@stvlley
@stvlley Жыл бұрын
awesome video!! what is the extension that pops up to show what each function does?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
It's typescript extension. It is just enabled for js files as well.
@AndrewTSq
@AndrewTSq Жыл бұрын
I just came to curried functions, but I cant understand even after you explained it. Why and where do I use it in real life? It just seems to complicate stuff by using this? Everything else has been crystal clear :)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
I would recommend you to skip them for now and try to learn later at some point. Curried functions and functional programming are quite difficult topics and for sure not needed if you are a beginners for example. You use curried functions to create partially applied functions. Like const getId = R.prop('id') const getIds = R.map(getId) const result = getIds(users) It is not a silver bullet, just another way to write code which simplifies some things.
@AndrewTSq
@AndrewTSq Жыл бұрын
@@MonsterlessonsAcademy okie :) i still dont get it lol. But I guess I have to know where the steeringwheel is in the car before I can drive :) thanks anyway. The other thing was very good for me, i understood them :)
@garikmelqonyan6011
@garikmelqonyan6011 6 ай бұрын
Good job, bro 👍
@MonsterlessonsAcademy
@MonsterlessonsAcademy 6 ай бұрын
Thanks ✌
@lastspoil5547
@lastspoil5547 5 ай бұрын
Will your Full Javascript Interview Prep Course be enough to prepare for JS interview questions. Will I still need to study Leet Code?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 ай бұрын
A lot of students wrote that they passed interview after studying my course. But it all depends on the interviewer and questions. Nothing can give you all possible answers.
@lastspoil5547
@lastspoil5547 5 ай бұрын
@@MonsterlessonsAcademy you're honestly is well appreciated. I will be enrolling into your course.
@lastspoil5547
@lastspoil5547 5 ай бұрын
@@MonsterlessonsAcademy if we we remember the concepts and methods and explain how to solve a interview problem, will we be able to use the syntax from your course during the interview only after we explain solution first. I can remember the concepts/methods but I can not remember the syntax.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 ай бұрын
@@lastspoil5547 Remembering syntax will come with time. Concepts and methods is more important from my point of view.
@ahmadg3822
@ahmadg3822 2 ай бұрын
15:58 I am studying for interview with company called foo .
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 ай бұрын
:D
@WildThoughtsAI
@WildThoughtsAI Жыл бұрын
The reason for why arrays get mutated is because arrays are pass by reference, it has nothing to do with .push()
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
users.slice(2) doesn't mutate array but splice does. It's a method not only that arrays are mutable.
@mitrasu5918
@mitrasu5918 Жыл бұрын
Hello, need some clearance i'm a noob const curry = function (fn) { var arity = fn.length return function f1(...args) { *// = arity) { return fn(...args) *//
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Just write console.log in every line and check what it gives you. It will bring understanding.
@XfaN888
@XfaN888 Жыл бұрын
13:50 null is data type tho reason it returns object is js bug or something if i remember correctly
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
There are lots of bugs with data types in js.
@funstuff6445
@funstuff6445 6 ай бұрын
12:30 Wouldn't it be better to first filter and than sort?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 6 ай бұрын
Yes
@modambheema4620
@modambheema4620 2 жыл бұрын
This would be great if you provide the source code for practising or take test oneself.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
You get access to all source codes in the full course. monsterlessons-academy.com/courses/javascript-interview-questions-coding-interview
@smchap9474
@smchap9474 10 ай бұрын
For finIndex, wouldn't it be if index is greater or equal to 0? 0 is a valid index, yes?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 10 ай бұрын
Yes that was a typo which was updated in the full course
@valdezm_com
@valdezm_com Жыл бұрын
Thanks!
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Thank you so much for your support. It means a lot to me!
@YT-qo6rt
@YT-qo6rt 2 жыл бұрын
Make more videos like this 👍
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Sure 😊
@ahmedamerica
@ahmedamerica 11 ай бұрын
Thank you 🙏
@MonsterlessonsAcademy
@MonsterlessonsAcademy 11 ай бұрын
You’re welcome 😊
@osoningliztili6708
@osoningliztili6708 Жыл бұрын
I realized my mistake, here is correct version of my code: const names = [] users.map(({name}) => names.push(name)) console.log(names);
@ismailhocine2819
@ismailhocine2819 Жыл бұрын
You don't need to push it, as map returns a new array
@jatilyadav4000
@jatilyadav4000 Жыл бұрын
Amazing video
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Thanks!
@k4nful
@k4nful Жыл бұрын
Damn this is the first time I heard about currying.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Something new every day :)
@k4nful
@k4nful Жыл бұрын
@@MonsterlessonsAcademy especially in JavaScript 😊
@mkopoku
@mkopoku Ай бұрын
index > -1
@MonsterlessonsAcademy
@MonsterlessonsAcademy Ай бұрын
Yeap
@dragosp.7635
@dragosp.7635 Жыл бұрын
very good info bro
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Glad you think so!
@avertry9529
@avertry9529 2 жыл бұрын
Please excuse me as I'm working through many questions from different sources. isNameExists at 51:10 your using findIndex with index > 0 Shouldn't it be index.length > 0 as index 0 could be the value your looking for?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
You are totally right!
@TheDoubleMvp
@TheDoubleMvp 7 ай бұрын
36:25 Yeah I'm just going to cross my fingers nobody asks me to write this curried function in an interview lol
@MonsterlessonsAcademy
@MonsterlessonsAcademy 7 ай бұрын
Yeap, I feel the pain :)
@charlesssgraham
@charlesssgraham Жыл бұрын
Hello! This video is awesome! Small question on the first task: Wouldn't you rather create and sort a new array instead of mutating the original data? I always thought that was best practice, but I saw you didn't mind mutating the original array here. Is it just because it's an interview Q, so we know it won't affect the greater system? @Monsterlessons Academy
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Hi! In real project I typically try to create new data except of mutating them.
@georgenonis5967
@georgenonis5967 Жыл бұрын
@ minute 46 why dont you use .some?
@RezaJhayLacanlale
@RezaJhayLacanlale Жыл бұрын
Shouldn't the find index solution be >= 0 because 0 is a valid index?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Yes. You are right.
@alexisf7720
@alexisf7720 Жыл бұрын
on 12:50 wouldnt it be better to apply sort after filter is called, otherwise you would be sorting items that might not pass the isActive logic?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
You are totally right.
@ВасилисаХон-я6д
@ВасилисаХон-я6д 2 жыл бұрын
прекрасный канал, лайк подписка однозначно
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Thanks!
@TeeKay1969
@TeeKay1969 2 жыл бұрын
Great resource, very helpful, thank you so much! Question for kzbin.info/www/bejne/rZ-8fHtombRpaJI shouldn't it be greater than or equal to zero? In case the name is found in the first element?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
You are totally right. It was a typo.
@learningit2572
@learningit2572 Жыл бұрын
Thanks from Ukraine!
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Thank you too!
@ktk3487
@ktk3487 Жыл бұрын
I have a question for anyone in the web designer field. Do they ask these questions in the interview for web design because I'm going for that field and from all the websites I have created in school we never use anything advance like currying or closures so I was wondering if theses questions are for a different field?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
Web designer doesn't need any of it or any programming language at all. It is a totally different field and job.
@ktk3487
@ktk3487 Жыл бұрын
​@@MonsterlessonsAcademyThankyou for the reply. We use HTML and CSS quite a lot with some javascript however not to this level of javascript.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
@@ktk3487 This doesn't sound like a web designer knowledge at all. Only if you do web designer job mixed with frontender job.
@ktk3487
@ktk3487 Жыл бұрын
@@MonsterlessonsAcademy not sure, that’s what it’s called in my college class web design. We design the web using html, css, and some JavaScript with some typescript and react.
@BaurzhanZhetenov
@BaurzhanZhetenov Жыл бұрын
what is the ide color theme you use?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
It's gruvbox
@BaurzhanZhetenov
@BaurzhanZhetenov Жыл бұрын
thanks
@osoningliztili6708
@osoningliztili6708 Жыл бұрын
// write a code to get array of names from given array of users for this task I wrote this solution: const users = [ { id: 1, name: 'Jack', isActive: true, }, { id: 2, name: 'Jhon', isActive: true, }, { id: 3, name: 'Mike', isActive: false, }, ]; const ArrayOfNames = users; ArrayOfNames.map( ({ name } ) => name = console.log(name)) to be honest I am not good with foor loop, I deal better with forEach, map, filter, find methods, is this good solution??
@shakthinaarayananr7639
@shakthinaarayananr7639 Жыл бұрын
59:56 Can we use like this? instead of obj1.author.split(" ")[1] ---> obj1.author.split(" ") ex: const sortByAuthorLastName =(obj1,obj2)=>{ return obj1.author.split(" ")
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
There are different ways to solve the same task.
@michaelharrington5860
@michaelharrington5860 9 ай бұрын
Is `localeCompare` okay for this? books.sort((a, b) => (a.author.split(' ')[1]).localeCompare((b.author.split(' ')[1])))
@MonsterlessonsAcademy
@MonsterlessonsAcademy 9 ай бұрын
Yes it's fine
Javascript Coding Interview Questions- You Must Know Them
17:06
Monsterlessons Academy
Рет қаралды 17 М.
Javascript Coding Interview Questions | Advanced Javascript Interview Questions
17:05
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 61 МЛН
Je peux le faire
00:13
Daniil le Russe
Рет қаралды 22 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 20 МЛН
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,4 МЛН
React Interview Questions and Answers - Dominate Your Next Interview
45:43
Monsterlessons Academy
Рет қаралды 26 М.
5 Essential JavaScript Interview Questions
20:32
Coding With Chaim
Рет қаралды 91 М.
Typescript Interview Questions and Answers - Dominate Your Next Interview
53:34
Monsterlessons Academy
Рет қаралды 11 М.
10 JavaScript Interview Questions You HAVE TO KNOW
13:41
James Q Quick
Рет қаралды 59 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Mock Technical Interview - Javascript Developer Entry Level
1:36:22
Tech with Nader
Рет қаралды 500 М.
From Good to Great: Optimizing Angular Performance
9:38
Monsterlessons Academy
Рет қаралды 6 М.
JavaScript Interview questions everyone gets wrong
6:40
Catherine Li
Рет қаралды 28 М.
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 61 МЛН