JavaScript Object Literals

An object literal is a comma-separated list of name-value pairs wrapped in curly braces. Object Literals can contain others Object Literals, Arrays and Functions.

Connecting to a MySQL Database with the PHP library PDO

PDO stands for PHP Data Objets and support Prepared Statements

you can also use the bindParam method, like:

What is PHP?

PHP is a server-side programming language for websites. PHP along with MySQL are powerful tools for developing back-end applications

What is ECMAScript 6 or ES6?

ECMAScript 6 (ES6) is the specification or standard followed by many programming languages like JavaScript, JScript, ActionScript, etc. The most popular programmimg language following this specification is JavaScript, That is why many people call ECMAScript 6 JavaScript 6

New features introduced in ECMAScript 6:

The let statement allows you to declare a variable with block scope

The const statement allows you to declare a constant

ES6 allows function parameters to have default values:

Introduces a row of new methods like:

Array.find()
Array.findIndex()
Number.isInteger()
Number.isSafeInteger()

Introduces a row of new properties like:

EPSILON
MIN_SAFE_INTEGER
MAX_SAFE_INTEGER

What is Angular?

Angular is a front-end framework brought by Google based on TypeScript

To write apps with Angular you have to first install Angular CLI which will set up a Angular project for you

Install Angular CLI using NPM:

C:\>npm install -g @angular/cli

-g stands for global

Create a new Angular project called helloworld with Angular CLI

C:\>ng new hello-world

Start the Angular server

C:\>ng serve

and open a browser and call http://localhost:4200

An Angular component is basically a TypeScript class. An Angular application ist bronken up into components.

An Angular component has a declaration

Frequently used Keyboard Shortcuts

Open up Developer Tools in Chrome and Firefox
Windows: Ctrl + Shift + I
Mac: Cmd + Option + I

Open up the JavaScript Console
Windows: Ctrl + Shift + J
Mac: Cmd + Option + J

View Page Source Code:
Windows: Ctrl + U
Mac: Cmd + U

Multi-Cursor Editing (Using Multiple Cursors)
Select a word or piece of code
Windows: Ctrl + D
Mac: Cmd + D

What is Node.js?

Node.js is a Runtime Enviroment for executing JavaScript code outside the browser

Node.js is Asynchronous by default. Which means Node.js can handel several requests at the same time

When naming classes in Node.js the first letter of every word in the class name should be uppercase e.g. EventEmmitter. This convention is called Pascal Case (PascalCase) and when naming variables use camelCase e.g. firstName, lastName

Node.js has built-in modules which you can use within your modules.The most frequently used are:

The os module

The fs module

The events module

The http module

Node.js does not have a window object or a document object instead Node.js has a global object

Open a CMD window on Windows or a terminal in Mac OS to see if you have Node.js already installed:

C:\>node –version
v8.11.3

 

MySQL LEFT JOIN Example

Assuming you have these two MySQL tables

You can ask MySQL to show you all customers who has a valid credit card

MySQL output

 

What is MySQL?

MySQL is a relational database that uses the SQL language. SQL stands for Structured Query Language, e.g.:

 

What is JavaScript?

JavaScript is a programming language used to display dynamic HTML and CSS in Webbrowsers