Advertisement
IstiyakAminSanto

basic.js

Feb 3rd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var firstVariable = 'istiyak',
  2.     age = 20,
  3.     email, other;
  4.  
  5.     email = age;   
  6.  
  7.     console.log(firstVariable);
  8.     console.log(age);
  9.     console.log(email);
  10.  
  11. // this is single quota
  12. var singleQuote = 'This is sigle',
  13.     dobleQuote = "This is Doble", // this is doble quota
  14.     number = 20; //this is for numbe
  15.  
  16.     arrayTest = ['istiyak', 'Amin', 'Santo'];
  17.  
  18.     console.log(arrayTest[0+1]);
  19.  
  20.     objectTest = {
  21.         santo : 'good boy',
  22.         nayem : 'bad boy'
  23.     };
  24.     console.log(objectTest.santo);
  25.  
  26. // Arithmatic Operator
  27.    
  28. var addition = 50+50;
  29. var subtraction = 50-30;
  30. var multiple = 5*5;
  31. var division = 100/10;
  32. var modulus = 100%3;
  33.    
  34.     console.log(addition); //100
  35.     console.log(subtraction); // 20
  36.     console.log(multiple); // 25
  37.     console.log(division); // 10
  38.     console.log(modulus); // 1
  39.  
  40. var oneObject = new String('hello world');
  41.  
  42.     console.log(oneObject);
  43.  
  44.  
  45.  
  46. var color = function getColor(color) {
  47.     var test = console.log(color);
  48.     return true;
  49. }
  50.  
  51. (function newFunc() {
  52.     console.log("Invoked Automatically");
  53. }());
  54.  
  55. !function otherFunc(){
  56.     console.log("INvoked Automatically Tooo");
  57. }();
  58.  
  59.     console.log(window.location.href);
  60.  
  61. (function locaFunc() {
  62.     var local = "Hello World";
  63.     console.log(local);
  64.     console.log(addition);
  65. }());
  66.  
  67. (function thisFunc(){
  68.     "use strict"
  69.     var object = {
  70.         properity : "This is First Properity",
  71.         method : function () {
  72.             return this.properity;
  73.         }
  74.     }
  75.     console.log(object.method());
  76. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement