JSON.stringify with pretty output
JSON.stringify(some, null, 4)
Das formatiert das Objekt ’some‘ mit 4 Leerzeichen für die Einrückung.
document ready
…mit pure JavaScript:
(function () { })();
…mit jQuery:
$(document).ready(function () { });
Thanks and more: stackoverflow
HTML entities decode
…the secure way [nerdface].
let decoded = (new DOMParser()).parseFromString('Straße', 'text/html').documentElement.textContent;
NOT instanceof
…einfach ein Semikolon vor ‚instanceof‘ oder den ersten Operanden funzt nicht.
if (!(anObject instanceof BaseClass)) { // ... }