ES6 ES6 stands for ECMAScript6. ES6 was released in 2015 and is also known as the ECMAScript 2015. It is basically a standard, which the scripting languages have to follow. As we know, Javascript is a scripting language. JS also…
Category: JS
Parallel ajax request using Jquery
Let us assume we need to hit a lot of URLs to append data to a page this so to reduce the time we need to make these requests simultaneous. The below code contains an array of JSON values these…
How To Capitalize First Letter Of Each Word In Js ?
By using function: “replace()” is a iterative function calling a regex as first parameter and adding callback function as its second parameter we can achieve this. Regular Expression for Every Word in a String ( /\w\S*/g ) And Callback function…
Dynamic web form validation with predefined rules and messages
Sometimes when we are using same validation rules for a form in different location with different ID’s. To prevent repeating the code and make it more maintainable we define it as a function in one place. That is what this…
Json parsing to add an iterating element by Jquery
To reduce load time and improve user experience we use ajax to get add new element to existing html. let the response be: let the response is saved in var response let the place where response is appended is to…
Node Event Module
Node has a concept of event-driven programming, in which code is written to react rather than be called. Node has an inbuilt event module about which you learn in-depth from here, we will use event listener and event emitter method…
Js Filter And Sort
Filter – High order function used to filter any array with the help of the callback function it uses same argument as map only difference is the return type is either true or false. It return type is true value…
What is Short-Circuit Evaluation in JS?
Logical operators (&&, ||, &, |) are used to reduce the complexity which can be used concisely. ANDoperator (&&) returns first false for false value and last true for true values. But, OR operator (||) returns first true for truely…
How to Require Function Parameter in JS?
In es6 default parameter were added which is a welcome change, but what if you want to throw error if a parameter was not provided. Well you can do it by calling a closure in default parameter which can throw…
Form Validation And Ajax submission using Jquery Validation
Jquery has a validation plugin which requires “rules:” and “messages:”. Rules are the validation case that you want to check on an input field. And, Messages are the response to those input field which violates the rules. Jquery validation uses…