Tag Archives: web development

forEach( ), sort( ) and filter( ) for newbies

forEach() ES6 has introduced the forEach() method which allows you to loop through an array. Arrays as you may already know are of the type ‘object’. In contrast to the string,number,boolean, undefined and symbol types which are primitive data types. For example if we console.log the typeof operator to find the typeof array, objectwill be… Read More »

Sweet & Sour mongoose.js methods – 2

This is part of the ‘Sweet & Sour mongoose.js methods’ series. In this function we will write a method that acts upon the UserSchema to check whether an email OR username already exists in the database. As an example use-case, this method can then be used in the any of your routes files by exporting… Read More »

Conditionally rendering EJS template with res.locals in express.js

This snippet is to conditionally render navbar items based on whether a user is logged in OR not.  So toggle the ‘Login’ button to ‘Logout’ if the user is already logged in and vice versa. I admit it took more time that I had anticipated. Primarily because in the beginning I insisted on using a… Read More »

Transparent Non Bootstrappy – Twitter – Bootstrap Navbar

I did some breaking and re-making of twitter bootstrap’s navbar. I love how convenient everything in twitter bootstrap is with all the pre-defined classes etc but it does take some time to customize bootstrap components and make them a little less bootstrappy…. Here’s the HTML for and Css for the navbar which you can see… Read More »