JavaScript Errors: An Exceptional History
blog.appsignal.com
blog.appsignal.com
I remember alert without console.log as well but I was too young to understand the context.
For ios mobile dev I use Safari as a debugger. If I have to use Chrome, I basically use a scrappy console that I made on the HTML page itself.
Be careful about using JSON.stringify on objects as a debugging technique though, because you may not be able to see properties on the prototype chain ('inherited' properties), and some objects customize their serialization to JSON (supply a custom toJSON method) which in some cases can be misleading. Things like that have contributed to a number of my grey hairs. Yes, I'm talking about you, Geolocation Coordinates! :)
Chrome has really nice support for remote debugging on Android.
If you can't get physical access to the device to configure them for remote debugging, there are some other nice remote debugging tools. One example: https://jsconsole.com/remote-debugging.html
Back in the day when I was working on the Sage Notebook, there weren't good javascript consoles. I can't recall if Firefox had one at the time (around 2007, I think), but it was certainly missing from Safari, IE, and Opera. But, it was an interactive notebook -- so I hijacked the "input cell" we were using to concoct what was essentially a console.
Thank god I don't have to support IE anymore, what a mess it was.
That sounds surprising, because I thought most of those were based on Chromium. Do they not allow you to expose a remote debugging port that you can connect to from a desktop instance of Chrome?
I just got into webdev a year or so ago and on HN and other places the moral panic about JavaScript on the web is endless because some jerks are out there doing it wrong and everyone thinks of their US local news website (those are a mess) when they talk about it ... and they want to throw the baby out with the bathwater. Meanwhile I'm just trying to write some handy web apps that do it right but can't escape the "omg javascript" medium type articles.
I wonder if folks write some nasty stuff in C ... do people blame C?
To be fair, the language allows them to do it wrong by default with all that implicit type conversion and whatnot -- even in the original equality operator! You can write good JavaScript, but you have to purposefully avoid weird behavior that just isn't present in some other modern languages like Python and Ruby. JavaScript had a weird history, got expanded upon accidentally (i.e. through some browser vendor or another deciding to implement something) many times, and has always valued backwards compatability more than languages that feel comfortable expecting the user to install the relevant runtime.
> a = 100
> a is 100
True
> a = 1000
> a is 1000
FalseUntil Javascript removes the stupid from it's language, it will remain an embarrassment to developers. Completely inexcusable.
> Until Javascript removes the stupid from it's language, it will remain an embarrassment to developers. Completely inexcusable.
From that link:
> > typeof NaN
> > "number"
> > NaN == NaN
> > false
> > Ok, so the type of Not a Number is a number? And it also does not equal itself? Oh, well. Let’s try equality with other stuff.
Compliance with IEEE 754 is stupidity that is completely inexcusable? That NaN is non-reflexive is certainly irritating but a standards-compliant language is expected to adhere to that.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
They do, except they get coerced to strings in whacky ways. Objects can be used largely like arrays, and Arrays are Objects, but Array is more suited for an ordered collection of numerically indexed elements, and so has relevant properties and methods, like length and indexOf.
https://thenewstack.io/brendan-eich-on-creating-javascript-i...