comment récupérer les 10 premiers caractères d'une chaîne dans le nœud js

var str = '12345678value';
var strshortened = str.slice(0,8);
shravani