🤝 Embracing JavaScript's Flexibility with Type Coercion Explore JavaScript fundamentals with Kyle Simpson, author of You Don't Know JS. Learn about types, type conversion, comparisons (== vs ===), lexical scope, closures, and object-oriented features like this, prototypes, and classes. https://lnkd.in/g8Dv8k45 #WebDev #Programming #Coding #LearnToCode #JavaScript
Does Kyle Simpson still hold the same view about type coercion?
well, think of a case; You get value from backend, you convert the value depending on type within a function. if you force the function to accept only one type it will throw an error. it can be solved with a switch case i guess. you call different functions depending on type and this brings a new question; whats difference between calling different functions depending on type and doing type seperation in the function and calling only one function?
One comment I have with this - for those learning how to code, forget the words that you are hearing now. "Polymorphic", "Coercion", etc. You will come to this and say, "Coding is far too hard for me, I have no idea what he is talking about!" Trust me on this, this may be the best Javascript course known to man. You will 100% understand what he is talking about within an hour or two. Kyles teaching methology is one that should truly be studied alone, regardless of the content. Kyle Simpson is my GOAT, and a very close second is Will Sentance. Couple the two, and you will be 100% far more knowledgable with Javascript than most of the devs in your company. And it is all on Frontend Masters! Absolute legends.
I still tend to use lint to help remove coersion. But there are times it makes sense Some comments around why, expected inputs and truth table (via texts - jest or deno, deno bundle is back), comment exclusion lint testing that line of code And even if we use it in many place. It is about eliminating it from that one place you accidently add == instead of ===, and it causes a bug
🔨 Just like in construction, mastering the fundamentals is key in coding too. JavaScript's type coercion feature can be a powerful tool when understood and used correctly, much like our tools on a job site. Looking forward to diving into this! #ConstructionMeetsCoding #JavaScriptFundamentals
Frontend Masters your content is a daily upgrade for my frontend skills appreciate the share 🫡
Interviewers need to understand this, no one introduces such complications in their code. Why ask these questions then?
#JavascriptForLife
This guy is a true goat on JS, love to watch/read his content.