function add(x,y) {
return x+y;
}
let xs = ["馃崚","馃崙","馃崓"];
let ys = ["馃崌","馃崏","馃崍"];
function sum(n) {
}
function arraySum(xs) {
}
function length(xs) {
}
function maximum(xs) {
}
function range(n, m) {
}
function reverse(xs) {
}
function elem(x, xs) {
}
function insert(x, xs) {
}
function sort(xs) {
}
function split(char, str, acc="") {
}
split(" ", "La vida es una lenteja"); // ["La", "vida", "es", "una", "lenteja"]
function insertBy(fn, x, xs) {
}
function sortBy(fn, xs) {
}
function maximumOn(fn, xs) {
}
const ponies = ["Applejack", "Pinkie Pie", "Rainbow Dash", "Fluttershy"];
maximumOn(x => x.length, ponies);
function arraySum(xs) {
if(xs.length === 0)
return 0;
const [head, ...tail] = xs;
return head + arraySum(tail);
}
const fruits = ["banana", "apple", "pineapple", "kiwi", "peach", "strawberry", "melon"];
getEmoji("pear");
const fruits = ["banana", "apple", "pineapple", "kiwi", "peach", "strawberry", "melon"];
const emojis = fruits.map(getEmoji);
isGreen("馃崘");
// f(x1, f(x2, f(x3, .... f(xn, init))))
function foldr(fn, init, xs) {
if(xs.length === 0)
return init;
const [head, ...tail] = xs;
return fn(head, foldr(fn, init, tail));
}
// f(f(f(f(init, x1), x2), x3), ... xn)
function foldl(fn, init, xs) {
if(xs.length === 0)
return init;
const [head, ...tail] = xs;
return foldl(fn, fn(init, head), tail);
}
const split = $.split;
function upper(word) {
if(word.length === 0)
return "";
return word[0].toUpperCase() + word.slice(1);
}
function capitalize(phrase) {
}
// capitalize("la vida es una lenteja"); // "La Vida Es Una Lenteja"
const add =
function compose(g, f) {
}
const pets = ["馃惗","馃惀","馃惎"];
likes("馃惀");
items("馃崠");
function rightTriangles(n) {
const list = $.range(1, n);
return undefined;
}
const jumps = [[1,2],[2,1],[-1,2],[2,-1],[1,-2],[-2,1],[-1,-2],[-2,-1]];
const onBoard = ([x,y]) => x >= 1 && x <= 8 && y >= 1 && y <= 8;
const moveKnight = ([x,y]) => undefined;
const reachIn3 = start => undefined;
function splits(xs) {
}
function permutations(xs) {
}