Tag Archives: JavaScript

JavaScript console.log: Next Level Debugging

If you are working in web development, you have probably encountered JavaScript at some point. As the following chart shows, it has been a dominating language for many years now, and still holds a strong position, probably due to the large number of frameworks using it (Angular, Backbone, Node, React, Vue.. to name a few). Then you are probably familiar with the famous logging method: console.log(). But, are you using it to its full potential ? Here is a glimpse of a few powerful hacks to debug JavaScript. Logging Objects Let’s dive directly into the core of the console with … Continue reading JavaScript console.log: Next Level Debugging

How to get an Element Starting with Class Name: the * and ^ JavaScript Selectors

You certainly know * and ^ as selectors in different programming languages. But you may have found some surprising (or frustrating) results while using them as JavaScript or jQuery selectors. Let’s say you want to access elements starting with a certain class name, for example, “fruit-“ in the following code: First, the syntax Your first reflex may be to try something like that: The correct syntax is: Then, the selectors: ^ vs * Using the ^ selector is correct, but its behavior is a bit too literal: it will get the very first element starting with the class name, or … Continue reading How to get an Element Starting with Class Name: the * and ^ JavaScript Selectors