Building Weather App in NodeJS in 17 Lines

In this tutorial, We are going to write NodeJS app with help of the Weather API from openweathermap.org which provides us daily temperature with the every rate fresh data.

We have used a request module and HTTP server concept in this tutorial.

695 total views, 5 views today

 

Learning Javascript : Object Creation Patterns

There are majorly Four patterns to create an Object in Javascript.

  • Constructor Pattern.
  • Factory Pattern
  • Prototype Pattern
  • Dynamic Prototype Pattern.
  • Use this keyword to attach
  • Don’t return anything.
  • Create Dummy Object
  • Return this object after 
Prototype Pattern
  • Put things in Shared space (Prototype).
  • Kind of assign default values.
Dynamic Prototype Pattern. – http://jsbin.com/tajiwof/edit?js,console
// Dynamic Prototype Pattern  – Object Creation

Lexical Scoping 
Inner Function Automatically has the Outside variables access.
// Lexical Scoping  – Inner Functions have access to OUTER Variables
Closure in Javascript

289 total views, 3 views today

 

How to create an Object in the Javascript?

In this tutorial, We are going to understand what is Object and how we can create Objects in the javascript.

What is Object?
An object is a collection of properties, and a property is an association between a name (or key) and a value. A property’s value can be a function, in which case the property is known as a method.

coffe cup

Let’s take an example, Suppose we have a Coffee cup. It has properties like the blue in color, hot in nature, etc. So let’s convert this real life object into the computer language.

Open the Cloud9 Online  Editor . (It’s a online code editor available online.).

 

 

Now we write the properties for it.

An Object can have method associated, Let’s have function/method that can be used to convert the temperature in C to F and attached to our coffeeObject.

To access the Object key, we have to use the dot pattern. e.g object.key.
Please note you can also access the object key’s value by

That’s all folks in the next tutorial we are going to learn more about the object oriented programming in javascript.

code js