ex-FAANG Developer vs "Impossible" JavaScript Quiz

  Рет қаралды 67,758

Conner Ardman

Conner Ardman

2 ай бұрын

How well do I know JavaScript? Let's find out with this supposedly impossible JavaScript quiz!
JavaScript Quiz: javascriptquiz.com/
Prepping for your frontend interviews? Use code "conner" for a discount on my product FrontendExpert:
www.frontendexpert.io/conner
🎬 TikTok: / connerardman
💼 LinkedIn: / connerardman
💻 Video/Coding Gear (affiliate): www.amazon.com/shop/connerardman
Business/brands 👉 youtube@connerardman.com

Пікірлер: 120
@ThePrimeTimeagen
@ThePrimeTimeagen 2 ай бұрын
i got them all right and got immediately hired by a FAANG company
@blazerowland407
@blazerowland407 2 ай бұрын
no he didn't hes lying
@thumbsuckerjoe
@thumbsuckerjoe 2 ай бұрын
Can confirm.
@brockdaniel8845
@brockdaniel8845 2 ай бұрын
Nicee !!!
@Endem1cProductions
@Endem1cProductions 2 ай бұрын
i got them all wrong and now i'm homeless
@frankjosephjr3722
@frankjosephjr3722 2 ай бұрын
Why on earth does typeof return a string instead of the actual type
@brandonkellner2920
@brandonkellner2920 2 ай бұрын
So [] == 0 == false if it's a number, and [] == true if it's a boolean, that makes a lot of sense. Thanks, javascript.
@eugeneponomarov7429
@eugeneponomarov7429 2 ай бұрын
Empty array is evaluated the same way as empty object in js - it just substitutes the object/array with reference to heap (like 0xFFFFFFFFFFFF) which is true. But Number([]) is super weird and makes no sense. Well, this code makes no sense, so why the result should make sense...
@brandonkellner2920
@brandonkellner2920 2 ай бұрын
@@eugeneponomarov7429 Interesting. I don't write javascript, so I had no idea why it would work that way.
@GBOAC
@GBOAC 2 ай бұрын
@@eugeneponomarov7429because determinism should be separate from the subjective perception of something making sense or not.
@matts154
@matts154 2 ай бұрын
While this quiz is a fun way to test of your knowledge of Javascript, these scenarios are why we have "use strict" and linting rules.
@harshvardhansankpal716
@harshvardhansankpal716 2 ай бұрын
what does strict mode do ? it abolishes all these activities
@andreikhotko5206
@andreikhotko5206 2 ай бұрын
I see 1 good use case for String.raw: defining a string variable containing backslashes. For example, windows filepath. String.raw`D:\path\to\file`, which is more readable than "D:\\path\\to\\file". This can be applicable to any string value containing backslashes which you don't want to escape everytime. It can be even inlined SQL script which can contain string literals (not a good idea, but anyway)
@wntiv
@wntiv 2 ай бұрын
personally was thinking with regex, if you needed to use the constructor (for whatever reason), which takes the representation of the regex *as a string*, in which you would have to double-escape any special chars (e.g. \d -> "\\d"). This would not be necessary using String.raw.
@cameronball3998
@cameronball3998 2 ай бұрын
exactly. i’ve used raw strings all the time for defining static regex in python code. e.g., `r’my raw string’`
@soniablanche5672
@soniablanche5672 2 ай бұрын
Yep. I have a script that uses String.raw to store a Windows path in a variable.
@joshix833
@joshix833 2 ай бұрын
Just use slashes for paths. Why would one use backslashes?
@cameronball3998
@cameronball3998 2 ай бұрын
@@joshix833 windows’ path separator is the backslash; it’s necessary to use to delimit a path on windows
@bobcoleman2920
@bobcoleman2920 2 ай бұрын
I recently used a version of String.raw in C# where instead you use the @ symbol before the string (string myString = @"my string contains "quotes" and stuff"), and this was for adding a SQL Server connection string to my app, so instead of using \ before the " to consider it part of the string itself, you use the raw value of the string which is everything contained within the outermost quotes
@BeccaYetiammo
@BeccaYetiammo 2 ай бұрын
10:18 I haven’t heard of String.raw in JS but there is a similar feature in Dart. One use case for them is declaring regular expression string literals. You don’t have to deal with escaping certain characters etc.
@benl9878
@benl9878 2 ай бұрын
love when people bring up they are a former faang employee. i don't bring up that I use to bag groceries at kroger.
@ConnerArdman
@ConnerArdman 2 ай бұрын
Much like crossfitters, we are contractually obligated to bring it up at all possible moments
@Q_20
@Q_20 2 ай бұрын
String.raw is useful with creating regular expression dynamically
@user-hr7wl8xr7o
@user-hr7wl8xr7o 2 ай бұрын
String.raw is pretty useful when you work with windows-like path in Node.js
@acirinelli
@acirinelli Ай бұрын
Floating point arithmetic caused me so many problems until I learned about it. Switched to all integers and convert to decimals.
@schwidola3549
@schwidola3549 2 ай бұрын
Looks like useful knowledge to debug weird code that some co-worker might have written, if they didn’t know those pitfalls 😅
@soham9119
@soham9119 2 ай бұрын
I would like to hear your thoughts on Devin AI and it's impact on job market
@Fishpizza1212
@Fishpizza1212 2 ай бұрын
For the floating point precision problem: Does JavaScript give you standard library tools to deal with errors in floats? I'm just wondering because in other languages, like Rust or C, you can just cast 0.1 and 0.2 as f32 (Rust) or float (C) which then is equal to 0.3, so 0.1 + 0.2 == 0.3 is true when cast as f32. Rust: println!("{}", 0.1 as f32 + 0.2 as f32 == 0.3 as f32); Even other interpreted languages like Python give you the 'decimal' module as part of the standard library, which lets you handle it like so: Python: from decimal import Decimal print(Decimal('0.1') + Decimal('0.2') == Decimal('0.3')) which returns true. The Decimal module handles decimal numbers as exactly their mathematical equivalent (up to a certain cutoff, which can be manually extended).
@scezar8880
@scezar8880 2 ай бұрын
the rust thing is really weird but surprisingly true though I don't think it's comparable to the decimal lib in python it's just that JS floats are 64 bit by default, and you're manually casting it to 32 bits which have less precision, or something
@guillaumebrunerie
@guillaumebrunerie 2 ай бұрын
It’s just by accident that with f32 you get 0.1 + 0.2 == 0.3. Try 0.1 + 0.6 == 0.7 for instance and you will get false in Rust while you get true in Javascript. Decimal numbers are not comparable at all to floats, for instance 1 / 3 is not a decimal number, which makes them pretty useless for many applications.
@thekwoka4707
@thekwoka4707 Ай бұрын
There isn't really a way to solve them in any language. It just happens to work out in some ways. You can just do integer math to avoid it.
@yega3k
@yega3k 2 ай бұрын
This is why I hate dynamic languages (a little 😅)
@foo0815
@foo0815 2 ай бұрын
Dynamic languages are ok, automatic type conversion isn't.
@stefanalecu9532
@stefanalecu9532 2 ай бұрын
Are you really projecting your hate towards JS onto other dynamic languages? Python doesn't have this skill issue, for instance
@yega3k
@yega3k 2 ай бұрын
It’s an issue that can only happen in a dynamic language because it has to do some kind of type “guessing” since your types are not explicitly defined. I’m learning Elixir right now and I also don’t like the “ambiguity” of type sometimes - like having a list of mixed types. So it’s not just JS (although JS could be the worst offender). That said, I still use JS and Python and as mentioned I’m learning Elixir - another dynamic language so no need to get defensive 😉
@yega3k
@yega3k 2 ай бұрын
I take back my previous reply. Automatic type conversion does make a big difference.
@AbbyChau
@AbbyChau 2 ай бұрын
just blame JS. the rules are so messy.
@RayBellis
@RayBellis Ай бұрын
9/10, and only because I was fooled by the correct answer for `typeof NaN` not having string quotes around it so I had ruled it out.
@davidlightfoot3217
@davidlightfoot3217 2 ай бұрын
When coding in Python, at least, I would use raw strings for regex
@harshvardhansankpal716
@harshvardhansankpal716 2 ай бұрын
plz tell me theses are the stress buster questions which u and ur interviewer will laugh on after him asking abt, promises, event loops and other stuff.
@borjinator
@borjinator 2 ай бұрын
I surpringly got all correct except number cast of empty array in question 7
@ConnerArdman
@ConnerArdman 2 ай бұрын
Nice! 👏👏👏
@CitizenKen1
@CitizenKen1 2 ай бұрын
Dude looks like Peewee Herman and the guy who played Polkadot man from The Suicide Squad.
@domesticcadiz
@domesticcadiz Ай бұрын
What is funny is i only knew the one you got wrong. I got a lot to learn 😂
@deadlyecho
@deadlyecho 2 ай бұрын
I got 8/10, the first one got me, I didn't even know that '0' means octal 😂 and what the fuck is string raw 😂😂
@thekwoka4707
@thekwoka4707 Ай бұрын
Starts off wacky. Since in strict mode the first one would throw an error, not evaluate to anything. And modules are automatically strict mode.
@ExpensivePizza
@ExpensivePizza 2 ай бұрын
It's actually insane that we ended up on the timeline where JavaScript exists.
@kazmi401
@kazmi401 2 ай бұрын
Delete it Before interviewers come here.
@ryostyles9904
@ryostyles9904 2 ай бұрын
So i failed to answer all the ones which you answered right, but answered the one you answered wrong 😢
@ConnerArdman
@ConnerArdman 2 ай бұрын
If we combine our powers, we’d be unstoppable…
@WeaselOnaStick
@WeaselOnaStick 2 ай бұрын
​@@ConnerArdmanOr fail all 100%
@chiragbansal7786
@chiragbansal7786 2 ай бұрын
Only got 7/10 right, time to quit being a JS dev and start farming or something
@ivangechev4243
@ivangechev4243 2 ай бұрын
This is quiz is filled with questions only related to javascript behaviors that are weird and most likely if you know what you do won't ever see.
@ConnerArdman
@ConnerArdman 2 ай бұрын
Yeah that’s kind of the point haha. And while you’ll never see these things specifically, I actually think knowing them is a decent proxy for having a deep understanding of the language.
@herok3447
@herok3447 2 ай бұрын
Thank god, we dont send people into space using this language
@fulconandroadcone9488
@fulconandroadcone9488 2 ай бұрын
Just wait and you'll see someone do it.
@spartanboosts
@spartanboosts 2 ай бұрын
Cool vid!
@iamplk
@iamplk 2 ай бұрын
why he looks like AI character. all time i was analysing his movements lol
@ConnerArdman
@ConnerArdman 2 ай бұрын
Too much time working for the Zuccbot, so I’m still part lizard robot for now…
@iamplk
@iamplk 2 ай бұрын
@@ConnerArdman are you for real a robot?
@abdelrhmanmohamed4754
@abdelrhmanmohamed4754 2 ай бұрын
hi can you make a video how much javascript is enough before react js , because someine tell me i should can build in big app with js , is that true
@DarthVader11912
@DarthVader11912 2 ай бұрын
If you want to learn JavaScript and react do the Odin project it's amazing and very detailed.
@ConnerArdman
@ConnerArdman 2 ай бұрын
There is no single threshold, it’s pretty subjective. You should be pretty comfortable with JavaScript though imo.
@yt-sh
@yt-sh 2 ай бұрын
kzfaq.info/get/bejne/o5tlg7eHutjQnnU.html just start building at first, then you'll dive deeper and deeper
@MrHenryG123
@MrHenryG123 2 ай бұрын
Why on earth does typeof return a string instead of the actual type
@ConnerArdman
@ConnerArdman 2 ай бұрын
Because it has to return a value like any other function, operator, etc. Types aren’t values. For example, you can’t return just the number type. You need a value to describe what type it is, and a string like “number” is a reasonable way to do that.
@MrHenryG123
@MrHenryG123 2 ай бұрын
@@ConnerArdmanI suppose that is reasonable in JavaScript since there are not that many actual types (i.e. you can't define your own so you probably don't care about the robustness. Not to say it isn't robust, it just seems a bit unintuitive at first)
@RayBellis
@RayBellis Ай бұрын
@@ConnerArdman you actually can return types e.g. `Number` from a function. There must be some other reason that JS doesn't do that. Try e.g. const n = () => Number ; n()(3)
@ConnerArdman
@ConnerArdman Ай бұрын
That is not returning a type. Number is a constructor function for creating Number objects. I guess you could make an argument for returning these wrapper object constructors, but I think that would be _really_ messy.
@RayBellis
@RayBellis Ай бұрын
@@ConnerArdman hmm, true, but constructor functions are _almost_ an analog for types, especially since the ES5 class syntax.
@bdafeesh
@bdafeesh 2 ай бұрын
Jezuz, so much JS ready to ruin your day. An empty array is truthy?? Implicit string-> number conversion...but only sometimes where it's number -> string conversion instead!? Implicit bool -> number conversion?! My mind is melting...
@RayBellis
@RayBellis Ай бұрын
NB: the questions are not always the same.
@Everythingwithharneet
@Everythingwithharneet 2 ай бұрын
Just had a doubt that are these test and things actually useful in the code like when I work with JavaScript I don't use all this stuff if something is there that I don't understand I learn it on the go is it the right approach or like I need to reevaluate?
@ConnerArdman
@ConnerArdman 2 ай бұрын
If you used something in this video regularly, you would probably be doing something wrong haha. I think understanding how these things work can be a good proxy for understanding of how the language works, but this is just a fun quiz. It's not meant to be the most practical knowledge ever.
@RayBellis
@RayBellis Ай бұрын
@@ConnerArdman yes, this. If you don't explicitly ensure that all of your variables are of the type you expect, or if you use operators on types for which they are not intended so that implicit coercion happens, then you deserve all you get. The coercion rules *are* specified and deterministic, but no-one should be using them.
@nathanbourquin6554
@nathanbourquin6554 2 ай бұрын
Leading zero becomes an octal number because… 0 looks like O?
@jason13gaming
@jason13gaming 2 ай бұрын
Re-title the video to “10 reasons to avoid JavaScript at all costs”
@suhaib_nisar
@suhaib_nisar 2 ай бұрын
❤ from Kashmir
@user-ml5em9eo2e
@user-ml5em9eo2e 2 ай бұрын
My god JavaScript is a horrible language
@AbdurRahim-eu3zr
@AbdurRahim-eu3zr 2 ай бұрын
More videos like this
@ConnerArdman
@ConnerArdman 2 ай бұрын
🫡
@MyWatermelonz
@MyWatermelonz 2 ай бұрын
Lol, people actually defending the dumpster fire that is JS
@fulconandroadcone9488
@fulconandroadcone9488 2 ай бұрын
Well it is right in the name Just Sucks
@kxhu
@kxhu 2 ай бұрын
me no no wanna
@SnazzieTV
@SnazzieTV 2 ай бұрын
These questions are stupid, no real world scenario would you have these.
@zFede_Rico
@zFede_Rico 2 ай бұрын
i learned something today: Do NOT use javascript.
@MrJester831
@MrJester831 2 ай бұрын
This video makes JS look really bad
@foo0815
@foo0815 2 ай бұрын
Because it is.
@matthewchampagne9621
@matthewchampagne9621 2 ай бұрын
This language has to be a joke
@fulconandroadcone9488
@fulconandroadcone9488 2 ай бұрын
Joke Script
@foo0815
@foo0815 2 ай бұрын
Javascript is just the most stupid programming language ever.
@p1p1sasa
@p1p1sasa 2 ай бұрын
I HATE JAVASCRIPT!!!!!
@jvfr-
@jvfr- 2 ай бұрын
lol those are useless, stupid ass questions. this ain't never happening in a real world project. I hate when interviewers ask those kind of questions, It just shows that I shouldn't have even bothered to participate in the process
@jonragnarsson
@jonragnarsson 2 ай бұрын
JavaScript? More like JesuScript, beause you will be constantly saying Jesus Fucking Christ, What The Fuck is going on in the language?
@MasterSamus
@MasterSamus Ай бұрын
All this proves is that JavaScript is a shitty language made in a weekend. And all standards and tooling for it follow the same philosophy of rushed and esoteric for the dumbest reasons.
@myanrueller91
@myanrueller91 2 ай бұрын
“JavaScript default sort converts to strings first.” And this is why people don’t like JavaScript.
@RayBellis
@RayBellis Ай бұрын
Rubbish. Perl's default sort functor is also a string sorter. A sort function has to have _some_ default functor so why should it be a numerical sort instead of a lexical sort?
@Samarichitane
@Samarichitane 2 ай бұрын
What a clown language. I hate it.
@PatrickMageez
@PatrickMageez 2 ай бұрын
This is why I avoid using JavaScript. It's a very nonsensical language
@jvfr-
@jvfr- 2 ай бұрын
people would k1ll somebody because of a programming language lol as long as javascript keeps paying my bills it can keep returning these weird values
@DaDescriptor
@DaDescriptor 2 ай бұрын
JavaScript sucks
@jonsmith7718
@jonsmith7718 2 ай бұрын
i gotHelloTwitter world correct ...lol and i didn't see the answers before hand either ...
9 JavaScript Features You’ve Never Used
19:36
Conner Ardman
Рет қаралды 24 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 141 М.
PINK STEERING STEERING CAR
00:31
Levsob
Рет қаралды 21 МЛН
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 3,7 МЛН
Watermelon Cat?! 🙀 #cat #cute #kitten
00:56
Stocat
Рет қаралды 36 МЛН
ex-FAANG Developer vs "Hardest" JavaScript Quiz
12:33
Conner Ardman
Рет қаралды 23 М.
The Ultimate Tier Programming Tier List | Prime Reacts
26:57
ThePrimeTime
Рет қаралды 322 М.
Why do Most New Developers Quit Early?
4:45
Bankai
Рет қаралды 1,2 М.
Interview with Senior JS Developer 2024 [NEW]
6:45
Programmers are also human
Рет қаралды 444 М.
Reacting to Controversial Opinions of Software Engineers
9:18
Fireship
Рет қаралды 2 МЛН
Software engineer interns on their first day be like...
2:21
Frying Pan
Рет қаралды 13 МЛН
Google Coding Interview With A Facebook Software Engineer
49:59
Clément Mihailescu
Рет қаралды 922 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 992 М.
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 227 М.
How Slow Is JavaScript? | Prime Reacts
15:34
ThePrimeTime
Рет қаралды 171 М.
После ввода кода - протирайте панель
0:18
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 1,9 МЛН
ВЫ ЧЕ СДЕЛАЛИ С iOS 18?
22:40
Overtake lab
Рет қаралды 128 М.
Apple watch hidden camera
0:34
_vector_
Рет қаралды 64 МЛН
МОЩНЕЕ ТВОЕГО ПК - iPad Pro M4 (feat. Brickspacer)
28:01
ЗЕ МАККЕРС
Рет қаралды 84 М.