2016-03-25 20:03:49 +00:00
|
|
|
exports.print = function (obj) {
|
|
|
|
return obj.constructor.name
|
|
|
|
}
|
2015-12-29 20:11:31 +00:00
|
|
|
|
2016-03-25 20:03:49 +00:00
|
|
|
exports.echo = function (obj) {
|
|
|
|
return obj
|
|
|
|
}
|
2016-07-25 07:30:40 +00:00
|
|
|
|
2018-05-24 12:05:46 +00:00
|
|
|
const typedArrays = {
|
|
|
|
Int8Array,
|
|
|
|
Uint8Array,
|
|
|
|
Uint8ClampedArray,
|
|
|
|
Int16Array,
|
|
|
|
Uint16Array,
|
|
|
|
Int32Array,
|
|
|
|
Uint32Array,
|
|
|
|
Float32Array,
|
|
|
|
Float64Array
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.typedArray = function (type, values) {
|
|
|
|
const constructor = typedArrays[type]
|
|
|
|
const array = new constructor(values.length)
|
|
|
|
for (let i = 0; i < values.length; ++i) {
|
|
|
|
array[i] = values[i]
|
2016-07-25 07:30:40 +00:00
|
|
|
}
|
2018-05-24 12:05:46 +00:00
|
|
|
return array
|
2016-07-25 07:30:40 +00:00
|
|
|
}
|
2018-06-13 07:38:31 +00:00
|
|
|
|
|
|
|
exports.getNaN = function () {
|
|
|
|
return NaN
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getInfinity = function () {
|
|
|
|
return Infinity
|
|
|
|
}
|