How to replace text in JavaScript

Javascript on MoreOnFew.com

Working with text or strings in JavaScript is really interesting. In fact text or “String” as it is called in JavaScript is the most common data type that a JavaScript programmer would encounter quite often. And many a times your would come across scenarios where you might have to replace a text in JavaScript. Thankfully, … Read more

What is the difference between Number.isInteger() and Number.isSafeInteger() in JavaScript ?

Javascript on MoreOnFew.com

As a part of ES6 (also known as ECMAScript 2015 or ECMAScript 6), there are a couple of new JavaScript features and methods introduced. Today we would be concentrating on just two of them i.e Number.isInteger() and Number.isSafeInteger(). What is Number.isInteger() ? The Number.isInteger() is a new method of the Number object introduced as a … Read more

How to set proxy using npm config in NodeJs?

Javascript on MoreOnFew.com

While working with NodeJs you’ll notice that many times you might not be able to install or update while working behind a proxy network like the corporate web proxy of your office etc. Basically, you might notice that the commands like npm install is not working. However, this can be easily fixed by setting the … Read more

How to empty an array in JavaScript ?

Javascript on MoreOnFew.com

Arrays are widely and commonly used in JavaScript. Especially if you are developing a dynamic app, there are very high chances that you might use Arrays in JavaScript. However, many a times I’ve noticed that people don’t use the Array related methods properly and end up doing certain things in a wrong way. One such … Read more

How to fix Load Timeout for Modules Error in RequireJs

Javascript on MoreOnFew.com

RequireJs is a very helpful JavaScript Module Loader. If you’ve been working on BackboneJS, AngularJs, or KnockoutJs you would have most likely come across RequireJs. Also, it is very likely that while working with RequireJs you would have come across the Error : Load timeout for modules message. The possible causes for this error Load timeout for … Read more

How to join or merge an Array in JavaScript?

Javascript on MoreOnFew.com

I’m sure you must have had a scenario where you had to join or merge two different Arrays. Well, let me tell you that its an easy task. However, there are different ways this can be done. Merging multiple arrays using Array.concat() method. JavaScript has a native method Array.concat() which does it. Let’s take a look … Read more

How to search for a string in JavaScript?

Javascript on MoreOnFew.com

The String data type must be the most common data type that we use in JavaScript. One of the most common functionality around string that we would have come across is to search for a string/character/word within another string. You can easily search for a word in javaScript using the string.search() method of JavaScript. The … Read more

How to use Crossroads.js? A tutorial with examples

Javascript on MoreOnFew.com

Are you making a Single Page Application  or an SPA ? And Do you want to update the URL of the page without reloading the page? Do you want your page to respond to the change in the URL without reloading the page? In Short, if you are looking for a javascript routing library then … Read more