Skip to content

Instantly share code, notes, and snippets.

View woliveiras's full-sized avatar
🤖
Always typing code

William Oliveira woliveiras

🤖
Always typing code
View GitHub Profile
@woliveiras
woliveiras / constants.js
Created December 9, 2019 14:10
Escale - Code Challenge
const toFrom = {
0: "zero",
1: "um",
2: "dois",
3: "três",
4: "quatro",
5: "cinco",
6: "seis",
7: "sete",
8: "oito",
function* generatorFunction(){
var index = 0;
while(true)
yield index++;
}
let myIterator = generatorFunction();
console.log(myIterator)
(defn my-recursive-sum
([numbers] (my-recursive-sum 0 numbers))
([total numbers]
(if (empty? numbers)
total
(recur (+ (first numbers) total) (rest numbers)))))
(defn my-recursive-sum
([numbers] (my-recursive-sum 0 numbers))
([total numbers]
(if (empty? numbers)
total
(my-recursive-sum (+ (first numbers) total) (rest numbers)))))
(defn hello
([] (hello "Eae!?"))
([name] (str "Eae, " name "!?")))
(defn my-recursive-sum [total numbers]
(if (empty? numbers)
total
(my-recursive-sum (+ (first numbers) total) (rest numbers))))
def my_structured_sum (numbers):
total = 0
for number in numbers:
total += number
return total
const {
Route,
Link,
Router
} = require('react-router');
const myObject = {
onePassion: 'JS', crazy: true
};
const {onePassion, crazy} = myObject;
console.log(onePassion) // 'JS'
console.log(`Crazy people? ${crazy}`) // "Crazy people? true"