Mission 28 / 52• Text Objects - Bracket Pairs

Delete Inside Brackets

`di{` (or `di}`) deletes everything between curly braces while keeping the braces intact.

It works with parentheses (`di(` or `di)`) and square brackets (`di[` or `di]`) as well!

Delete inside brackets

  • di{delete inside curly braces { ... }
  • di(delete inside parentheses ( ... )
  • di[delete inside square brackets [ ... ]
1
function calculateDiscount(price, user) {
2
const base = price * 0.9;
3
return base;
4
}

Place cursor anywhere inside the function body and type `di{`. The entire contents vanish, leaving empty `{}`!

Now it's your turn!

  1. Navigate to each green target across the code snippet.
  2. Use the motions and techniques learned in this lesson to land accurately on each target.
  3. See how fast you can complete 10 targets.
0/10
1
function calculateDiscount(price, user) {
2
const base = price * 0.9;
3
return base;
4
}
NORMAL
00:00