I have selected a JS block such as following:
function map(xs: string[], cb: Function) : string[] {
const result: string[] = [];
for(let i = 0; i++; i < xs.length) {
result.push(cb(xs[i]));
}
return result;
}
Now I want to go to the beginning of each line and comment out each line in the block (inserting //
at the beginning of each line). How can I do this in the fastest way possible using text objects? I am aware that this is also possible by doing column selection Ctrl + V, <number>
j, I, //
and ESC sequence. But I want to do this in the fastest way possible.