結果 : write a javascript function to extract a specified number of characters from a string