flâneur — a map of the web's best reading

Is this true?

notes.jordanscales.com · 1,611 words · saved by 1 readers

That's pretty much the same code. There is no else, so we'll get to the end and return undefined - which is not true.

Is this true? Is this true? You're writing some code - maybe building out some new features - and it's time to test your work. For some reason, you named your function fn and, for some reason, you want the result to be true . describe ( "our function" , ( ) => { it ( "returns true" , ( ) => { expect ( fn ( ) ) . toBe ( true ) } ) } ) A pretty reasonable scenario, right? Let's make it unreasonable. Pretend you're the unit test, and instead of the describe and it above, I'll give you a function and you’ll tell me if it returns true when it's called. Is this true? function fn ( ) { return true }

Explore this link on the map →

related reading