If i + 1 is even, its remainder will be zero (or false). Now well take a look at the most common DOM manipulation methods, text(), append(), remove(), style(), and attr()`. In this Programming with Mosh course, you will learn about JavaScript basics like objects, arrays, and functions. Now we run through a loop, defining the position of a small segment of the wave for each point in the buffer at a certain height based on the data point value from the array, then moving the line across to the place where the next wave segment should be drawn: Finally, we finish the line in the middle of the right-hand side of the canvas, then draw the stroke we've defined: At the end of this section of code, we invoke the draw() function to start off the whole process: This gives us a nice waveform display that updates several times a second: Another nice little sound visualization to create is one of those Winamp-style frequency bar graphs. To build the visualizer, well be using two inbuilt browser APIs: Canvas and Web Audio API. Beginner's D3.js Tutorial: Learn Data Visualization with JS, What is jQuery? Next, we start our draw() function off, again setting up a loop with requestAnimationFrame() so that the displayed data keeps updating, and clearing the display with each animation frame. But the more you understand your errors the easier it is to fix them. To ensure that a subset of JavaScript files in your workspace is treated as a single project. Method chaining is a technique that lets you string multiple methods together. This code finds the