Book Image

Web Development with MongoDB and Node.js

By : Jason Krol
Book Image

Web Development with MongoDB and Node.js

By: Jason Krol

Overview of this book

This book is designed for developers of any skill level that want to get up and running using Node.js and MongoDB to build full featured web applications. A basic understanding of JavaScript and HTML is the only requirement for this book.
Table of Contents (14 chapters)
12
12. Popular Node.js Web Frameworks
13
Index

A JavaScript Primer


Node.js is just JavaScript on the server. The language syntax and tools you are used to with coding JavaScript on the browser will work verbatim on the server. Node.js has additional tools that are only available on the server, but the language and syntax again are the same. I'm assuming you have a general understanding of the basic JavaScript syntax, but I will introduce JavaScript to you with a very brief primer on the language just in case.

In general, JavaScript is a fairly simple language when it comes to syntax, and you only need to know a few important elements.

Declaring variables

The most basic thing you can do in pretty much any programming language is declare a variable. Unlike most other languages, JavaScript is a dynamically typed language, which means when you declare a variable, its value can be of any type and can change during the course of its lifetime. However, in contrast, a strongly typed language dictates that a variable defined as a type of string...