diff options
Diffstat (limited to 'src/operators/unshift.js')
-rw-r--r-- | src/operators/unshift.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/operators/unshift.js b/src/operators/unshift.js new file mode 100644 index 0000000..c572af0 --- /dev/null +++ b/src/operators/unshift.js @@ -0,0 +1,12 @@ +WingAPI.createOperator("unshift", [ + { + type: "variable" + } +], (parameters, value, name, error) => { + if (personalities[name].includes("list")) { + lists[value].unshift(variables[parameters[0]]); + return value; + } else { + error("Variable does not have the list personality"); + } +})
\ No newline at end of file |