Skip to content

Instantly share code, notes, and snippets.

View n-rodriguez's full-sized avatar
🏠
To hire!

Nicolas Rodriguez n-rodriguez

🏠
To hire!
View GitHub Profile
@n-rodriguez
n-rodriguez / ArrayObjectDemo.coffee
Created September 9, 2021 23:26 — forked from frane/ArrayObjectDemo.coffee
Traversing arrays and objects in CoffeeScript
# Traversing arrays and objects in CoffeeScript
# The array and object we use for testing
arr = [1, 2, 3, 4, 5]
obj = {a: 1, b: 2, c: 3, d: 4, e: 5}
# 'in' has a different meaning in CoffeeScript than in JavaScript
# CS: element in array -> JS: array.indexOf(element) >= 0
console.log '5 in arr: ' + (5 in arr)