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