From 676e541926c8f77c3533a3e008193ef656374eb6 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 20 Jan 2019 14:39:46 +0200 Subject: [PATCH] javascript(ultra32): clone Signed-off-by: prescientmoon --- javascript/ultra32/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javascript/ultra32/app.js b/javascript/ultra32/app.js index b9849ea..e7dad04 100644 --- a/javascript/ultra32/app.js +++ b/javascript/ultra32/app.js @@ -42,3 +42,10 @@ function rotate(vector) { return vector; } exports.rotate = rotate; +function clone(vector) { + const newVec = new Float32Array(vector.length); + for (let i = 0; i < vector.length; i++) { + newVec[i] = vector[i]; + } + return newVec; +}