#JavaScript – Console-log-viewer.js an amazing script to overlay console in your HTML apps

Buy Me A Coffee

Hi !

Yes, I know, I’m writing about JavaScript. It’s 2020, so anything can happen, and here I am, blogging about JavaScript.

So, I’m learning a lot of TensorFlowJs, and having some kind of logging is a must. I’m a huge fan of Edge Developer Tools, however in some scenarios, like a browser in a smartphone, just have the chance to display the console.log() in the app is a super useful feature.

And, that’s the main idea of [console-log-viewer.js] (see references), just add an script into your HTML and magic!

console-log-viewer.js displays logs and Javascript errors in an overlay on top of your site. Useful for mobile webdevelopment. Installed in 5 seconds [1]. Works on every device and browser [2].

console-log-viewer.js

Just add this script into the Html, and refresh the page.

<script src="https://markknol.github.io/console-log-viewer/console-log-viewer.js"></script>

There are other options, like start minimized, at the bottom, etc.

In the following animation, I’m checking the Console Log, while I’m loading and using a Machine Learning model in a browser to detect the use of Face Masks.

Happy coding!

Greetings

El Bruno


References

console-log-viewer.js

#Coding4Fun – Sorting Arrays in #JavaScript, #Python and #CSharp … choose your own adventure

Buy Me A Coffee

Hi !

Not my usual set of posts, however this keep me thinking a lot. It all started with this tweet; an usual joke about JavaScript, and how it works with types.

array sorting in Javascript

I noticed that some responses focused on the “you need to know how the language works” before posting this. And it is correct, you need to know how JavaScript converts the elements into strings and then sort, to understand the crappy not so accurate output.

However, I am not a JavaScript expert, and I do not want to be one. And, when I use a tool or a programming language, I expect to have a nice learning curve; the previous example is not a nice “Welcome to JavaScript, where arrays and type conversions will make you think twice until you get it!”.

I’ve been doing a lot of Python programming, so I did the same exercise, and it worked as you may expect !

array and sort in python

I also did a similar in C#, and it also worked !

array and sort in C#

Do not get me wrong, this is not an Anti-JavaScript post. JavaScript is awesome and is almost everywhere. I know a lot of awesome JavaScript programmers, who I really admire.

However as a developer, I expect to avoid something simple like an array sort issue. I will always focus on “the code is clean and everyone will understand how it works, just read the code!”.

I am used to this as a C# developer; and I also found that Python is cool for this. But, sometimes, just sometimes, JavaScript looks like hell !

Bonus: An old post in my last JavaScript adventure.

Happy coding!

Greetings

El Bruno