fix wrong return type of callback of map function

This commit is contained in:
Jongsu Liam Kim
2018-11-02 06:16:17 +09:00
parent f01ba112a9
commit 11bd60fc59
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1345,7 +1345,7 @@ declare namespace math {
* the Matrix/array being traversed.
* @returns Transformed map of x
*/
map(x: Matrix | MathArray, callback: ((value: any, index: any, matrix: Matrix | MathArray) => Matrix | MathArray)): Matrix | MathArray;
map(x: Matrix | MathArray, callback: ((value: any, index: any, matrix: Matrix | MathArray) => MathType | string)): Matrix | MathArray;
/**
* Create a matrix filled with ones. The created matrix can have one or
+7
View File
@@ -270,6 +270,13 @@ Matrices examples
math.range('2:-1:-3');
math.factorial(math.range('1:6'));
}
// map matrix
{
math.map([1, 2, 3], function(value) {
return value * value;
}); // returns [1, 4, 9]
}
}
/*