Christine Al-Thifairy

Freelance JavaScript Developer

Hi, I'm a JavaScript developer based in Sydney, available for freelance or contract work.

Backbone.js AngularJS jQuery Bootstrap HTML5 CSS3

JavaScript Quiz

What is a closure?

A closure is an inner function that has access to the outer function's variables

What is the difference between == and ===?

When a comparison is made using the double-equals operator, it will check the values of both expressions and convert them to a common type and return true if both are equal. So comparing a number with a string having the same value will return true.

The triple-equals operator, also called strict equals or identically equal never does type converting. Instead it will compare the value and the type. So comparing a number with a string having the same value will return false.

Describe how promises are used in JavaScript

JavaScript is single threaded so it is largely synchronous (blocking) but there are also asynchronous (non blocking) operations such as AJAX calls and events.

Promises are objects that represent the value of a long running operation and provide an API for handling that value when it arrives.

A promise can be:

  • Fulfilled - The action relating to the promise succeeded.
  • Rejected - The action relating to the promise failed.
  • Pending - Hasn't fulfilled or rejected yet.
  • Settled - Has fulfilled or rejected.

This blog article explains the meaning of a promise in AngularJS in a very simple way.

AngularJS Examples

Backbone.js Examples

HTML5 Examples