scrimba
Frontend Career Path
Essential JavaScript concepts
JS Mini Projects
Spread Syntax (...) Challenge
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Spread Syntax (...) Challenge
AboutCommentsNotes
Spread Syntax (...) Challenge
Expand for more info
index.js
run
preview
console
const averageSharePriceByMonthQ1 = [109.6, 103.3, 89.4]
const averageSharePriceByMonthQ2 = [109.3, 126.1, 103.3]
const averageSharePriceByMonthQ3 = [120.8, 102.3, 106.8]
const averageSharePriceByMonthQ4 = [110.9, 119.8, 113.7]

function findPriceExtremes(arr){
/*
Challenge:
2. Find the highest number from the array
and store it in the const 'highest'.
3. Find the lowest number from the array
and store it in the const 'lowest'.
*/
const highest = //???
const lowest = //???
console.log(`The highest average share price was ${highest}`)
console.log(`The lowest average share price was ${lowest}`)
}

/*
Challenge:
1. Call this function with one array holding
all of the data from the 4 arrays above.
*/
findPriceExtremes()
Console
!
SyntaxError: Unexpected token 'const'
,
/index.html
-5:16