Last active
August 29, 2015 14:21
-
-
Save shoaibuddin/14b92ed7350d17075ac0 to your computer and use it in GitHub Desktop.
Programming Basics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Variable | |
var name = 'Altaf'; | |
//String | |
var name = 'Altaf'; | |
//Number | |
var something = 10; | |
//Object or Empty object | |
var obj = {}; | |
// Object with name value pairs | |
var person = { | |
firstName: 'John', | |
lastName: 'Doe', | |
age: 50, | |
eyeColor: 'blue' | |
} | |
//Object with Method | |
{ | |
firstName: 'John', | |
lastName: 'Doe', | |
age: 50, | |
eyeColor: 'blue', | |
fullName: function() { | |
return this.firstName + " " + this.lastName; | |
} | |
} | |
//Function | |
function sayHello() { | |
//Some code goes here | |
console.log('Hi, How are you?'); | |
} | |
//Operators | |
+ Addition | |
- Subtraction | |
* Multiplication | |
/ Division | |
% Modulus | |
++Increment | |
--Decrement |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment