Getting first 3 letters of a string in javascript

Substring in javascript:

How to get substring of a string in javascript:

var station=”Chennai”;

var res = station.substring(0, 3);alert(res);

result will be “Che”.