Basic JavaScript for Beginners

var bar = “Hero”;
console.log(bar);
bar.toUpperCase();
console.log(bar);
//Ans:
//Hero
//HERO
  • string
  • number
  • boolean
  • undefined
  • symbol
  • null
console.log({});
console.log([]);
console.log(x => x * 2);
//Ans:
//{}
//[]
//x => x * 2
console.log(2+6)
//the answer is: 8
console.log (typeof (2)); // “number”console.log(typeof(“hello”)); // “string”console.log(typeof(undefined)); // “undefined”
console.log (typeof ({})); // “object”console.log (typeof ([])); // “object”console.log (typeof (x => x * 2)); // “function”
try {// code…} catch (err) {// error handling}
  • Different browsers are other than the one or two that you use regularly on your devices, including slightly older browsers that some people might still be using, which don’t support all the latest, shiniest CSS and JavaScript features.
  • Different devices with different capabilities, from the latest greatest tablets and smartphones, through smart TVs, right down to cheap tablets and even older feature phones that may run browsers with limited capabilities.
  • People with disabilities, who use the Web with the aid of assistive technologies like screen readers, or don’t use a mouse (some people use only the keyboard).

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store