UNPKG

ndarray-fill

Version:
16 lines (12 loc) 247 B
"use strict" var cwise = require("cwise") var fill = cwise({ args: ["index", "array", "scalar"], body: function(idx, out, f) { out = f.apply(undefined, idx) } }) module.exports = function(array, f) { fill(array, f) return array }