Skip to content

Instantly share code, notes, and snippets.

@shoaibuddin
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoaibuddin/14b92ed7350d17075ac0 to your computer and use it in GitHub Desktop.
Save shoaibuddin/14b92ed7350d17075ac0 to your computer and use it in GitHub Desktop.
Programming Basics
//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