November 2018
Beginner
502 pages
10h 22m
English
function drawPoint(x: number, y: number, z: number) { ...}
We also have the following point variable:
const point: [number, number, number] = [100, 200, 300];
How can we call the drawPoint function in a terse manner?
drawPoint(...point);
drawPoint(1, 2, 3);
Internally in the implementation of drawPoint we draw the point from a tuple data type, [number, number, number]. How can we define the method parameter(s) with the required tuple?
function drawPoint(...point: [number, number, number]) { ...}
Read now
Unlock full access