# Introduction In this challenge, we will be writing a JavaScript function `averageOfLevels` that accepts the root of a binary tree as input and returns an array of the average values of each level in the tree. We will need to implement the logic inside the `averageOfLevels` function to calculate the average values for each level of the binary tree. The function should be exported as shown in the provided code snippet, and it should not be modified.
Click the virtual machine below to start practicing