Skip to main content

Posts

React Tutorial

React Tutorial From Basics React Tutorial From Basics Random Things to Remember React Tutorial From Basics Random Things to Remember Using () implicitly returns components.Role of index.js is to render your application.The reference to root comes from a div in the body of your public html file.State of a component is simply a regular JS Object.Class Components require render() method to return JSX.Functional Components directly return JSX. Class is className in React.When parsing for an integer just chain Number.p...

Regular Expressions in JavaScript

Regular Expressions In JavaScript Regular Expressions In JavaScript Basic: Regular Expressions In JavaScript Basic: Anchors ^ Start of string or line \A Start of string $ End of string or line \Z End of string \b Word boundary \B Not word boundary ...

Mutability And Reference VS Privative Types in JavaScript

Mutability And Reference VS Privative Types in JavaScript Mutability And Reference VS Privative Types in JavaScript Mutability && Primitive && Reference Examples Mutability And Reference VS Privative Types in JavaScript Mutability && Primitive && Reference Examples Mutability In JavaScript, String values are immutable, which means that they cannot be altered once created. For example, the following code: var myStr = "Bob"; myStr[0] = "J"; ...

Knex Cheat Sheet

knex-cheatsheet Knex Setup Guide Create your project directory Create and initialize your a directory for your Express application. $ mkdir node-knex-demo $ cd node-knex-demo $ npm init Knex Knex is a SQL query builder, mainly used for Node.js applications with built in model schema creation, table migrations, connection pooling and seeding. Install Knex and Knex Command Line Tool Install knex globally on your local computer. $ npm install knex -g This will allow us to use knex as a command line tool that helps you create and manage your knex files. In addition, you will need to also install the knex module locally to use in your project. $ npm install knex --save Configuring your database For our example, we're going to be connecting to a PostgreSQL database, we'll need to install the pg module. $ npm install pg --save W...