first 20 letters of text js code example Example: js only first 50 letters 'Hiya how are you'.substring(0,50);