ex-FAANG Developer vs 'Impossible' JavaScript Quiz

preview_player
Показать описание
How well do I know JavaScript? Let's find out with this supposedly impossible JavaScript quiz!

Prepping for your frontend interviews? Use code "conner" for a discount on my product FrontendExpert:

Рекомендации по теме
Комментарии
Автор

i got them all right and got immediately hired by a FAANG company

ThePrimeTimeagen
Автор

So [] == 0 == false if it's a number, and [] == true if it's a boolean, that makes a lot of sense. Thanks, javascript.

brandonkellner
Автор

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.

matts
Автор

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)

andreikhotko
Автор

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.

BeccaYetiammo
Автор

love when people bring up they are a former faang employee. i don't bring up that I use to bag groceries at kroger.

benl
Автор

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

bobbythebearded
Автор

It's actually insane that we ended up on the timeline where JavaScript exists.

ExpensivePizza
Автор

Floating point arithmetic caused me so many problems until I learned about it. Switched to all integers and convert to decimals.

acirinelli
Автор

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).

Fishpizza
Автор

String.raw is pretty useful when you work with windows-like path in Node.js

никитатолочко-йэ
Автор

String.raw is useful with creating regular expression dynamically

Q_
Автор

Starts off wacky. Since in strict mode the first one would throw an error, not evaluate to anything. And modules are automatically strict mode.

thekwoka
Автор

Re-title the video to “10 reasons to avoid JavaScript at all costs”

jasongaming
Автор

I surpringly got all correct except number cast of empty array in question 7

borjinator
Автор

This is why I hate dynamic languages (a little 😅)

yegak
Автор

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.

harshvardhansankpal
Автор

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.

RayBellis
Автор

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.

ivangechev
Автор

Dude looks like Peewee Herman and the guy who played Polkadot man from The Suicide Squad.

AKen_Films
visit shbcf.ru