Number Extensions in Javascript

Number benefits from several changes in ES6, providing several of new methods saving us from writing our own potentially error prone implementation. There are quite a lot of methods so here are some of the ones that are likely to have more use: Number.isFinite Determines whether a number is finite (finite means that it could be measured or have a value). Number.isFinite(Infinity); //false Number.isFinite(100); //true Number.isInteger Determines if a number is an integer or not....

July 17, 2018 · 2 min · Rezha Julio

JS & Dom - Tips & Tricks #3

As you might already know, your browser’s developer tools can be used to debug JavaScript by utilizing breakpoints. Breakpoints allow you to pause script execution as well as step into, out of, and over function calls. Breakpoints are added in your developer tools by means of line numbers where you indicate where you want script execution to be paused. This is fine until you start changing your code. Now a defined breakpoint may no longer be in the place you want it to be....

January 13, 2017 · 2 min · Rezha Julio

JS & Dom - Tips & Tricks #2

Last year, David Walsh published an article called 7 Essential JavaScript Functions where he shared some JavaScript utility/helper snippets. One of the interesting techniques used in one of the functions is where he gets the absolute URL for a page. He does this using something like the following: var getAbsoluteUrl = (function() { var a; return function(url) { if(!a) a = document.createElement('a'); a.href = url; return a.href; }; })(); // Usage getAbsoluteUrl('/something'); // https ://example....

January 9, 2017 · 2 min · Rezha Julio

JS & Dom - Tips & Tricks #1

There are many ways to read content from elements and nodes. Here’s another one that allows you to read and write an individual node’s value. It uses the nodeValue property of the Node interface. The nodeValue of an element will always return null, whereas text nodes, CDATA sections, comment nodes, and even attribute nodes will return the text value of the node. To demonstrate its use, I’ll use the following HTML:...

January 6, 2017 · 2 min · Rezha Julio

Essentials Javascripts Link

Whether you’re a javascript newbie or hero, you’ll find this link really usefull. ...

February 25, 2015 · 1 min · Rezha Julio