파이썬의 슬라이싱과 똑같다.
const a = "ABCDEFG";
const list = ["a", "b", "c", "d"];
const raw_data = a;
for(let raw_data of [a, list]){
let sliced = raw_data.slice(1, 3);
console.log(sliced);
sliced = raw_data.slice(-2, raw_data.length);
console.log(sliced);
sliced = raw_data.slice(-2);
}

위의 slice와 두가지가 다르다.
또한 .substring(data1) 인자 한개일 땐, data1은 startIndex로, 맨 끝까지 슬라이싱하게 된다.
쓰지 말자. js에서 공식적으로 deprecated되었다.