

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Arrays
incomplete
2: Type Parameters
incomplete
3: Heterogeneous Arrays
incomplete
4: Rest Parameters
incomplete
5: Evolving Any
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
The most common way to declare an array is using the bracket notation, string[], number[], etc.:
function trainJedi(jediKnights: string[]) {
for (let knight of jediKnights) {
console.log(`Training ${knight}...`);
}
}
trainJedi(["Dooku", "Qui-Gon", "Xanatos"]);
// Training Dooku...
// Training Qui-Gon...
// Training Xanatos...
Support.ai needs to calculate the performance scores for their support agents. Each agent receives customer ratings for their support interactions.
Complete the averageScore function. It takes an array of customer ratings numbers as input and returns their average score.
If the array is empty, return 0.