JavaScript Oddities
JavaScript Oddities
$43.19
Regular Price
$29.58
Bundle Price

JavaScript Oddities

Underhanded JavaScript
Javascript Technical Interview Questions
The following 2 books are included in this bundle...

About the Bundle

Ever wondered why [0] == 0? Why "true" == true returns false? What about the other oddities in JavaScript? Why is JavaScript so WTF worthy?

These books explain the above, and more. They're originally the same book, but was split into two after an A/B test of the titles. Whilst the content of both books are similar, the focus of the books are different. JavaScript Technical Interview Questions focuses more on helping the reader ace their technical interviews, while Underhanded JavaScript is more "fun", and contains more trivia about JavaScript.

  • Share this bundle

About the Books

Underhanded JavaScript

Underhanded JavaScript

How To Be A Complete Arsehole with Bad JavaScript
  • 104

    Pages

  • 29,997

    Words

  • 100%

    Complete

  • PDF

  • EPUB

  • MOBI

  • APP

"WTF, JavaScript! Curse you Eich! Damn you Crockford!! JavaScript is the worst language ever!"

Ever had those moments when reading someone else's JavaScript code and screamed something like the above? Code that appears to do one thing but actually does something else? Welcome to the weird and wonderful world of JavaScript.

JavaScript can be a beautiful language - there exists a book about 100 pages on the good parts of JavaScript after all. However it's more often than not more full of warts. The problem is JavaScript does not follow the principle of least surprise. There are JavaScript code out there that can surprise even the most experienced of JavaScript developers - not in a good way,  mind. Accidental globals are just the tip of the iceberg.

If you have ever seen WTF-worthy JavaScript code (and any JavaScript dev worth her salt would have encountered at least one) and wondered wtf is happening, this book is for you.

If you were surpised with the result of a particular piece of code, and wondered why the results are what they are, this book is for you.

If you have ever wondered why [0] == 0? Why "true" == true returns false then this book is for you.

In this book I go through ~12 examples of crazy JavaScript that would make anyone go "WTF??!", examples such as:

  • Why certain Immediately Invoked Function Expressions don't work?
  • Why in some contexts, commas act funnily.
  • Why in some cases newlines act funnily.
  • Why in some cases, Google Chrome appears to support block-level scoping without ES6 syntax
  • Why truthy values are not true, and why falsey values are not false
  • Why is eval evil?
  • What is foo)(
  • And many more

I go through these examples, and then explain how the examples happen and work, in a step-by-step manner. Then in a tongue-in-cheek manner, suggest ways to wreak havoc on the unsuspecting using said "quirks" of JavaScript. I for one do not actually condone such behaviour. However, all the examples in this book, I have actually seen in real life, and have often cursed the arsehole developers who wrote them. The actual main aim of this book is to help write better code by showing the obvious pitfalls that you may find when debugging other peoples' codes.

Sometimes, it's not that these developers are intentionally being arseholes. Most times, the code is well-intentioned, but due to the way the language (and/or implementation) works, the results come out unexpectedly. Other times, it is exceedingly intentional, and innocent-looking code can do a lot of (financial) damage. I cover these and more in the book.

If you want to know more about the content, here is a talk I gave about arsehole JavaScript

Who this Book Is For

This book assumes you are already an intermediate-to-advanced frontend or backend Javascript developer, and is considered to be light reading. Early reviews have compared it to a light-hearted Programmng Pearls for Javascript developers. This author thinks it's more like Programming Turds, but okay.

Current Status

The book is currently in final editing stages. No more new content will be added in the near future.

Javascript Technical Interview Questions

Javascript Technical Interview Questions

Prepare Yourself For That Dream Job
  • 88

    Pages

  • 24,864

    Words

  • 85%

    Complete

  • PDF

  • EPUB

  • MOBI

  • APP

You've applied for that Javascript position you've always dreamed about.

There is just one hurdle in your way: the technical interview

You really want that position. You get to play with the coolest new technologies and work with the best people. But you're rightfully worried about the technical interview..

"So," the interviewer asks you,

"Can you explain to me why "true" == true returns false? Please explain the steps in detail as well", she continues.

You quake in your boots. You know about truthy and falsey values, but you don't exactly know why a truthy value would return false. Worse, you need to be able to explain how it happened. If only you had brushed up on your knowledge of Javascript quirks. If only there were a book for such reference. You could have aced this interview.

Know the Whys and Hows

The good news is you still can. Like any interviews, you must prepare for your technical interview, especially so for Javascript, since there are many quirks to Javascript. Do you know them all? Why is eval and with frowned upon? Can you explain how variable hoisting happens, step-by-step? In many technical interviews, it is the "why" and "how" questions that kill. Prevent that from happening by preparing yourself. This book is for you. It gives you that deep knowledge required for the harder questions that will inevitably be asked.

It does not matter if the position you are applying is for a jQuery position, or a Node.js position. Javascript's quirks happen on both server-side and client-side.  This book covers the quirks found in the language itself. Unlike most other online resources, this book does not treat you like a dummy. It assumes you know your basics (and you should, since you're a rockstar Javascript developer) and merely cover the trickier parts of Javascript. Here are some of the things this book covers:

  • Why certain Immediately Invoked Function Expressions don't work?
  • Why in some contexts, commas act funnily.
  • Why in some cases newlines act funnily.
  • Why in some cases, Google Chrome appears to support block-level scoping without ES6 syntax
  • Why truthy values are not true, and why falsey values are not false.
  • What is the call expression foo)(
  • And many more!

If there is a book that will help you prepare for your Javascript interview, it is this one. Written in a conversational style, it helps you relax while conveying the deepest knowledge of Javascript. Exactly the way you would in an interview.

This book is exactly what you need to ace that interview.

About the Author

Xuanyi Chew
Xuanyi Chew

Xuanyi actually wrote this book while procrastinating on another much larger book on Javascript virtual machines. The inspiration for this book was derived from all the times he was driven crazy by bad and downright bizzare Javascript code. He decided to catalogue those quirks and write up explanations as to why they happen. He also very quickly realized that these are the sorts of questions technical interviewers would ask to test applicants' technical prowess. And so this book was born

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms

Write and Publish on Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub