A Glimpse of JavaScript’s String, Number and Arrays

  • Number
  • String
  • Boolean
  • Symbol
  • Object
  1. Function
  2. Array
  3. Date
  4. RegExp
  • null
  • Undefined
Math.abs(-5) // 5
Math.floor(5.3) // 5
Math.floor(5.6) // 6
Math.sqrt(9) // 3
Math.sin(0) // 0
const string = “Hello World”;string.length(); // 11string.indexOf(o); // 5string.toUpperCase(); //HELLO WORLDstring.toLowerCase(); //hello worldstring.charAt(5); // o
const jsArray = [‘index1’, ‘index2’, ‘index3’, ‘index4’];
jsArray[2]; // index3
jsArray.push(‘index5’);
// jsArray = [‘index1’, ‘index2’, ‘index3’, ‘index4’, ‘index5’]
jsArray.pop(); // jsArray = [‘index1’, ‘index2’, ‘index3’, ‘index4’]
jsArray.unshift(‘index0’);
// jsArray = [‘index0’, ‘index1’, ‘index2’, ‘index3’, ‘index4’]
jsArray.shift();
// jsArray = [‘index1’, ‘index2’, ‘index3’, ‘index4’]
jsArray.indexOf(‘index2’) // 1
jsArray.reverse();
// jsArray = [‘index4’, ‘index3’, ‘index2’, ‘index1’]
  1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
  2. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
  3. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number
  4. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
  5. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Back to Basics (React)

Server-Side Rendering for Websites or Gatsby vs Next.Js

E2E tests in minutes for frontend apps having web components and open shadow DOM

How Deadly can your JSON.stringify and JSON.parse be for your event loop?

Web Application Programming in PicoLisp: Some more GUI elements

Javascript Design Pattern — Part 1

Angular NgRx: Resolving Route Data

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
Al-Junaed Islam

Al-Junaed Islam

More from Medium

Should I make class member variables const or constexpr?

Understanding Higher Order Functions

What is recursive function?

JavaCript’s Classes: A Beginner’s Guide.