'slice()' Example
<html>
<body>
<button onclick="var myS = new String('Sample String');
alert(myS.slice(4,7));">SLICE STRING</button>
<button onclick="var myA = new Array(10,11,12,13,14,15);
alert(myA.slice(1,3));">SLICE ARRAY</button>
</body>
</html>
Related examples in the same category