javascript only allow show first few characters from a string

Solutions on MaxInterview for javascript only allow show first few characters from a string by the best coders in the world

showing results for - "javascript only allow show first few characters from a string"
Simone
22 Oct 2017
1var string = 'Hey, I am good';
2string.substring(0,3); // show first 3 characters
3//result "Hey"