<script type="text/javascript">

<!--

var str = '005001002001';


aaa = str.slice(0,-3);


document.write("<br>"+str);

document.write("<br>"+aaa);

//-->

</script>


관련 설명 페이지.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice