type.array.prepend0.000001
Prepends a value to an array.
Arguments
valuerequired
The value to prepend to the given array.Return Value
The array with the given value prepended.something went wrong :(
Prepending to an array
Setup
authorization=PROCAUTH
require "proc"
client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.type.array.prepend.call(
["foo", "bar"], value: "baz"
)
client.type.array.prepend.call(
["foo", "bar"], {value: "baz"}
);
curl "https://proc.run/type/array/prepend?value=baz" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/json" \
--data '["foo", "bar"]'
["baz", "foo", "bar"]
Stuck? Want to chat about an idea? Join the community on Discord.