mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-07 09:01:13 -05:00
fix(curriculum): typos in JS review (#60548)
This commit is contained in:
@@ -1610,7 +1610,7 @@ para.setAttribute("class", "my-class");
|
||||
|
||||
## `addEventListener()` and `removeEventListener()` Methods
|
||||
|
||||
- **`addEventListener` Method**: This method is used to listen for events. It takes two arguments: the event you want to listen for and a function that will be called when the event occurs. Some common examples of events would be click events, input events, change events, and input events.
|
||||
- **`addEventListener` Method**: This method is used to listen for events. It takes two arguments: the event you want to listen for and a function that will be called when the event occurs. Some common examples of events would be click events, input events, and change events.
|
||||
|
||||
```js
|
||||
const btn = document.getElementById("btn");
|
||||
@@ -1737,7 +1737,7 @@ const animation = square.animate(
|
||||
|
||||
## The Canvas API
|
||||
|
||||
- **Definition**: The Canvas API is a powerful tool that lets you and manipulate graphics right inside your JavaScript file. To work with the Canvas API, you first need to provide a `canvas` element in HTML. This element acts as a drawing surface you can manipulate with the instance methods and properties of the interfaces in the Canvas API. This API has interfaces like `HTMLCanvasElement`, `CanvasRenderingContext2D`, `CanvasGradient`, `CanvasPattern`, and `TextMetrics` which contain methods and properties you can use to create graphics in your JavaScript file.
|
||||
- **Definition**: The Canvas API is a powerful tool that lets you manipulate graphics right inside your JavaScript file. To work with the Canvas API, you first need to provide a `canvas` element in HTML. This element acts as a drawing surface you can manipulate with the instance methods and properties of the interfaces in the Canvas API. This API has interfaces like `HTMLCanvasElement`, `CanvasRenderingContext2D`, `CanvasGradient`, `CanvasPattern`, and `TextMetrics` which contain methods and properties you can use to create graphics in your JavaScript file.
|
||||
|
||||
```html
|
||||
<canvas id="my-canvas" width="400" height="400"></canvas>
|
||||
|
||||
Reference in New Issue
Block a user