{
  "id": 10632820,
  "title": "# Week 06 Task 03: Command Pattern in JavaScript",
  "url": "https://urgent.news/2026/09/29/week-06-task-03-command-pattern-in-javascript",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-29T07:04:57.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/koushikmaya/-week-06-task-03-command-pattern-in-javascript-3bkm"
  },
  "original_language": "en",
  "account": null,
  "summary": "The Command Pattern is a design pattern that encapsulates a request as an object, thereby allowing for parameterization of clients with queues, requests, and operations. This pattern is particularly useful in scenarios where you need to support undoable operations, such as in a text editor. In the context of Week 06 Task 03, the author implemented the Command Pattern by building a simple text editor with support for appending and deleting text, as well as undo functionality. This was achieved by defining four main components: TextEditor (the receiver), AppendCommand (a command that appends text), DeleteCommand (a command that deletes text), and EditorInvoker (the invoker that coordinates the execution of commands). The TextEditor acts as the receiver, performing the actual operations such as appending, deleting, and retrieving text. Each command object (AppendCommand and DeleteCommand) encapsulates the necessary information to perform its action and undo it. This separation of concerns allows for greater flexibility and maintainability in managing operations, making the system easier to extend and debug.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}