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

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'