get first two letter of an array javascript

Solutions on MaxInterview for get first two letter of an array javascript by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "get first two letter of an array javascript"
Arran
18 Jan 2016
1var str = '012123';
2var strFirstThree = str.substring(0,3);
3
4console.log(str); //shows '012123'
5console.log(strFirstThree); // shows '012'