Комментарии:
Are these questions helpful to you? What React questions have you encountered in your interviews? Let me know!
ОтветитьI can code and build apps with React. But explaining React in an interview, that I'm not confident.
ОтветитьGreat video, and great advice! I have an interview myself today and this was great.
The ternary operator question was a bit misleading: when using rhe && operator to conditionally render some element, you can simply cast arr.length to a boolean using !!arr.length && ..., this will be a very simple way to still use the && operator
class classname decision is purely based on react-core team's choice, & nothing else.
They knewnthat class can serve multiple meanings based on the contexts, which they dont wanted to get in.
The className thing has nothing to do with the class being reserved syntax as it's working just fine in Preact.
ОтветитьGood job, your explanations are great!
ОтветитьWent to an interview for a React dev - got asked questions on AWS, cors, oauth, and oauth2.0. Not a single frontend or react question. What even is the point?
ОтветитьGreat questions, and I like how to you explain the area where to shine. I would encourage to please create more React or Angular questions like these. Amazing, thanks a lot.
Ответитьprovide example and talk...
Ответитьwhat if I the condition is not about the length but it is undefined? ternary is long for that logical condition.
ОтветитьThis video was super helpful I never thought about whether or not the ternary or && operator would be better, since I usually use ternary but your response was definitely a huge plus to know
ОтветитьThank you so much! I was watching your video before my interview and I actually got asked the jsx question. I kinda knew it already, but, having researched it more thoroughly after this video, I was even more confident answering it. Really appreciate your help!
ОтветитьThank you.
ОтветитьI like your video format, other creators are boring jejejje
ОтветитьOne of the best. And yes these are the questions that are asked mostly especially Use Effect
ОтветитьThanks, great video. What's are some of the shibboleths of an amateur with react?
Ответитьdude, /highfive
ОтветитьGreat content, Peter!
ОтветитьI wouldn't call JSX syntactic sugar since it has to be transpiled.
ОтветитьIf i would been asked with only these difficulty of questions then I would be probably a react developer already :/
ОтветитьYou can still do someArray.length > 0 && renderElement()
Ответитьbug with && easily solved by double conversion like !!condition
ОтветитьThe last question is interesting. Because I have only use ternary operators when rendering component's, if possible.
I think, I'm gonna fail from the first question alone.
I either would say
Jsx is a file you usually use to create components or
Jsx is like a javascript but you can also put your html codes there...
These are good questions that I should learn about.
In my opinion, ternary makes code too long (sometimes we use null for the second condition) but it is easier to render component with a && operator
ОтветитьRegarding point #5: that's why we need to use double inversion in such cases, which casts the value into boolean: !!items.length && ...
ОтветитьVery helpful. Thank you! I appreciate if you talk about common mistakes programmers make when using react just like the && operator you mentioned in this video.
ОтветитьCan’t believe i found this!
ОтветитьThanks bro I found it useful👌👌👌👌👌👌👌👌
ОтветитьSo why do we not need to use className in svelte
ОтветитьI am working like a JS dev (react) for a long time. I was lost while during interview the CTO asked me what is "Hoisting". I stucked. After 5 secs of my cilence he asked me "whats the difference with let and var definition?" I understood the previous question.
So: during interview, a lot of companies use "smart definitions" you like to know. This is nothing related to the coding.
Didn't know about this ternary and &&, now I know. Thanks Peter.
ОтветитьReact is how you want to respond and control the screen or code outputs. Just process management controls. Three things. Get put react respond pm.
ОтветитьWe deployed that 0 into SIT
ОтветитьDang I would ace that lol. That’s like the simplest stuff you can know. But I’ve been working with react alone while in college for two years and I also just read a react 17 book that explained a lot of in depth concepts so maybe I’ve just finally reached a point passed beginner 😂
ОтветитьMost Asked Tuff Questions on React for 4+years experienced, you can watch part1 on channel - 'Codetailed'
Let see how many questions you can solve...
What is virtual dom and how does it work ?
ОтветитьRegarding the use of `&&` : This is an incomplete statement being compared with a ternary operator. To mimic ternary operators, always specify an `||` clause as well, so the expression always has something truthy to evaluate to in case the left-hand operand is false. So in the case of the Ken Dodds article, it would have worked just fine if he'd written `!!contacts.length && something || somethingElse`. I've used this code pattern in tons of production code with zero issues. (Also, note the use of `!!` to force an operand to a boolean value)
Ответитьamazing
ОтветитьInstead of && we could use the nullish coellescing operator, ?? , to bypass the situation
ОтветитьWas saving this for when I became ~technical~. Awesome stuff, Peter 👏
ОтветитьI usually use !!arr.length && .... instead of ternary condition.
Ответитьi am watching this few hours to my interview, i hope i scale through.
ОтветитьIf the length is 0, isn't that desired behavior to not evaluate the right side since the array is empty?
ОтветитьThis was really eye opening. Keep up the great content!
ОтветитьThey asked me what are solid princibles and can we apply them on react projects last time :/
ОтветитьOn the question regarding ternary vs && operator, I could see how that could happen, however if he used an expression like "array.length > 0 && ..." would that not fix the issue? I think there are situations where && is more readable and more concise to write and maintain.
ОтветитьAh finally, questions if asked I could answer and get hired.
Ответить