Category: functions

Instant Form Validation Using JavaScript

HTML5 introduces a couple of new attributes for implementing browser-based form validation. The pattern attribute is a regular-expression that defines the range of valid inputs for textarea elements and most types of input. The required attribute specifies whether a field is required. For legacy browsers that don’...

Back to Basics: JavaScript Operators, Conditionals & Functions

Table of Contents JavaScript Operators Assignment Operators Arithmetic Operators Addition Subtraction Multiplication Division Modulus Increment Decrement Comparison Operators Equal Strict Equal Not Equal Strict Not Equal Less Than Less Than or Equal To Greater Than Greater Than or Equal To Logical Operators And Or Not ...

My New Favorite ES6 Toy: Destructured Objects as Parameters

Like a lot of other developers, I’m working through my continued education learning what I can about ES6. One of the ways I’m doing this is to attend workshops by smart people. I went to Kyle Simpson’s ES6: The Good Parts course and found myself particularly interested in the practical applications of a piece of ...

Quick Tip: Function Expressions vs Function Declarations

JavaScript has two different ways of creating functions. Function declarations have been used for a long time, but function expressions have been gradually taking over. function funcDeclaration() { return 'A function declaration'; }var funcExpression = function () { return 'A function expression'; }D...