Delete Words

In this lesson, you'll learn how to use the delete operator with word and WORD motions.

Deleting words is an extremely common task in programming. Spend some time practicing so that you can complete this task effortlessly.

d
w
-delete a word
Example
d
W
w
-delete a WORD
Example
escape
-cancel the in progress operator
Example

Now it's your turn!

  1. Use the delete operator to delete words highlighted in red.
  2. Remember to use uppercase W if the highlighted text is a WORD.
  3. If you begin the delete operator in the wrong location, press ESC to cancel the operator.







function greet(name) {
return `Hello, ${name}!`;
}
const message = greet("world");
greet();
 0/15  00:00

Note: The delete operator (d) puts the deleted text into your clipboard, allowing you to paste it later with p. You will learn more about copy/paste operations in a later next lesson.