I have just been looking at a tutorial for 3js scrolling animation control. Just saw in the example code that there's this strange function declaration with parameters set up that I've seen before. They look like key value pairs. When I copied and pasted the entire javascript code provided by the tutorial into my IDE and run it, it tells me that the ':' is unexpected. I was just wondering if this a valid format and get some more info how this code works.
function lerp( x: number, y: number, a: number): number {
return (1 - a) * x + a * y
}