add (str)

This commit is contained in:
Quentin Leonetti 2019-07-14 06:12:06 +02:00
parent 15f1e6a2b1
commit b3fa6d26d5
2 changed files with 8 additions and 0 deletions

View File

@ -221,6 +221,10 @@ function Library (ronin) {
return arg return arg
} }
this.str = (...args) => {
return args.reduce((acc, val) => { return acc + val }, '')
}
this.test = (name, a, b) => { this.test = (name, a, b) => {
if (Array.isArray(a)) { if (Array.isArray(a)) {
// TODO: make testing more solid // TODO: make testing more solid

View File

@ -44,4 +44,8 @@
(def addOne (lambda (a) (add a 1))) (def addOne (lambda (a) (add a 1)))
(test "def - value" aaa 123) (test "def - value" aaa 123)
(test "def - func" (addOne 4) 5) (test "def - func" (addOne 4) 5)
; Generics
(test "str" (str 1 4 "-" (add 3 4) ".jpg") "14-7.jpg")
) )