Skip to content

Instantly share code, notes, and snippets.

View olavfosse's full-sized avatar
👨‍🔬
building

Olav Fosse olavfosse

👨‍🔬
building
View GitHub Profile
@olavfosse
olavfosse / reducible.clj
Created August 20, 2024 00:06
Telemere Reducible
(ns logs
(:require [clojure.edn :as edn]
[clojure.string :as str])
(:import java.nio.file.Path
java.nio.file.Paths
java.nio.file.Files
java.nio.file.OpenOption
java.io.PushbackReader
java.nio.file.LinkOption
java.io.InputStreamReader
const removeFromArray = function (){ // Takes an array and an arbitrary amount of primitive values. Returns an array where all elements from the array which are equal to one of the primitive value are removed.
arguments = Array.prototype.slice.call(arguments);
let array = arguments[0];
let valuesToRemove = arguments.slice(1);
let newArray = [];
array.forEach(element => {
if(!(valuesToRemove.includes(element))) {
newArray.push(element);
}
});