Quick Cheatsheet on some Javascript Basics

1) Global objects can be accessed via this operator in javascript.

2) Global properties that return a simple value and have no methods are:
Infinity, NaN, undefined, null

3) How to create a variable:
var myNameVariable = ‘name1’;
//Re-assigning the value:
myNameVariable = ‘name2’;

4) Primitive data types that are supported in Javascript are:
Boolean, Null, Undefined, Number, String, Symbol, Object
  • Boolean type can take true or false
  • Null can take exactly one value: null
  • Integers are 16-bit unsigned integer values
  • Object: It's like an object oriented programming concept of object.
5) Comments: Following are 2 types of creating comments.
  • /* */
  • //
6) Mathematical operators:
  • add/concatenation: +
  • subtract: -
  • multiple: * 
  • divide: /
  • assignment operator: =
  • Identity Operator: ===
  • Negation: !
  • Not equal: !==
7) How to define a function
function testFunc() {
alert(“Test”);
}

No comments:

Post a Comment

NoSQL

This one is reviewed but I need to delete its copy from hubpages or somewhere NoSQL Data models: key-value  Aggregate model.  key or i...