Advertisement
shopnilSS

Class 2

May 12th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //today's cover topic
  2.     //data type
  3.     //work of console log
  4.     //truth and false value
  5.     //work of variable and what is variable
  6.  
  7.  
  8.  
  9. //use of console.log
  10. // console.log('dsfsdfasdfksad;fjsd') //print the data
  11.  
  12.  
  13.  
  14.  
  15. //data type
  16.  
  17. //what is variable
  18. //var let  const
  19. // var name = 'shopnil'
  20. //in c++
  21. // string name = "shopnil"
  22. // int x = 5
  23. //float x = 5.5
  24. //bool x =true
  25. // console.log(name)
  26. // console.log(name)
  27. // console.log(name)
  28. // console.log(name)
  29.  
  30. // console.log("rohinga")
  31. // console.log("rohinga")
  32. //c++
  33. //int , double, float, bool, string
  34. //15 , 15/15.5, 15.5 , true/false, "a-z"
  35.  
  36. //array, function
  37. //js
  38. //data type // 2 type
  39. //1. primitive
  40. //2.Object
  41.  
  42. //Primitive //3 type
  43. //1.number 1 , -1, 15.35
  44. //2. boolean
  45. //3.string
  46.  
  47. //Number
  48. // [0-9], (-ve) , 25.5
  49.  
  50. //boolean
  51. //true false
  52.  
  53. //string
  54. //[a-z][A-Z] "" or 'true false'
  55.  
  56. //primitive data type end
  57.  
  58.  
  59.  
  60. //Object // 3 types
  61. //1.array
  62. //2.function
  63. //3.object
  64.  
  65. //other
  66. //NaN, undefined, null
  67.  
  68. //NaN
  69. // var data = Number("lakjflsda")
  70. // console.log(data);
  71.  
  72. //undefined
  73. // var x
  74. // var y = 5
  75. // console.log(x) //error
  76. // console.log(y)
  77.  
  78. //truthy value and falsy value
  79. //1.falsy data  (NaN, undefined, null , 0, "", false)
  80. //Boolean()
  81.  
  82. var res
  83. var a = Boolean(res)
  84. console.log(res); //undefined
  85. console.log(a); //false
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement