Defensive coding in JavaScript? That's absolutely not how most libraries are implemented.
Personally I saw over a million dollars lost and an entire team laid off after a piece of code started working with a value that was expected to be a number but wasn't.
Depends. You could debate the same philosophy wrt C and null pointers. Should you check all your arguments to see if they're null, if the documentation/specification says they should never be null, or accept undefined behaviour and segfault?
In practice, most code assumes everything is checked, sanitized and used correctly at the outer most API boundary.