Advertisement
Shahria

Education materials

Aug 17th, 2019
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const value = 10;
  2.  
  3. const values = [5, 10, 15, 20, 25];
  4.  
  5. console.log(value);
  6.  
  7. const name = 'Abhi Haq';
  8. values.length;
  9.  
  10.  
  11.  
  12.  
  13. //Loop structure
  14. for(var i = 0; i < MAX_NUMBER; i++)
  15. {
  16.  
  17. }
  18.  
  19. //non-changeable variable
  20. const tamim = [30, 50, 1, 60, 50, 40];
  21. //changeable varbiable
  22. let avg_run = 0;
  23.  
  24. //loop
  25. for(let i = 0; i < tamim.length; i++)
  26. {
  27.     //adding all variable into one
  28.     avg_run += tamim[i];
  29. }
  30.  
  31. //output + avarage number
  32. console.log(avg_run / tamim.length);
  33.  
  34.  
  35.  
  36. const abhi = 20;
  37. console.log(abhi);
  38.  
  39. console.log('+');
  40.  
  41. const Haq = 50;
  42. console.log(Haq);
  43.  
  44. console.log('=');
  45.  
  46. console.log(abhi+Haq);
  47.  
  48.  
  49. const abhi = 25;
  50. const fahim = 23;
  51.  
  52. if( abhi > fahim)
  53. {
  54.     //Abhi boro
  55.     console.log('Abhi is elder');
  56. }
  57. else if( abhi == fahim)
  58. {
  59.     //Duijon ei soman
  60.     console.log('Both are same age');
  61. }
  62. else
  63. {
  64.     //Fahim boro
  65.     console.log('Fahim is elder');
  66. }
  67.  
  68.  
  69.  
  70.  
  71. const abhi = 25;
  72. const fahim = 26;
  73.  
  74. if( abhi > fahim)
  75. {
  76.     //Abhi boro
  77.     console.log('Abhi is elder');
  78. }
  79. else if( abhi == fahim)
  80. {
  81.     //Duijon ei soman
  82.     console.log('Both are same age');
  83. }
  84. else
  85. {
  86.     //Fahim boro
  87.     console.log('Fahim is elder');
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement