How to use the typeOf function from mathjs

Find comprehensive JavaScript mathjs.typeOf code examples handpicked from public code repositorys.

174
175
176
177
178
179
180
181
182
183
from_points(var_1, var_2, var_3, var_4) {
    let point_1, point_2;

    if (var_3 == undefined && var_4 == undefined) {
        // Two points are given
        let is_matrix = (x) => math.typeOf(x) == "Array" && math.size(x) == 2;

        if (is_matrix(var_1) && is_matrix(var_2)) {
            function generate_point(variable) {
                return new Point(variable[0], variable[1]);
fork icon1
star icon0
watch icon1