Skip to content

Instantly share code, notes, and snippets.

@Siyanda
Created August 18, 2015 21:03
Show Gist options
  • Select an option

  • Save Siyanda/e9831934c6a9e2ae941a to your computer and use it in GitHub Desktop.

Select an option

Save Siyanda/e9831934c6a9e2ae941a to your computer and use it in GitHub Desktop.
Some helpful Jade syntax stuffs
// Loops (for) (each)
ul
for animal in ['dog', 'cat', 'mouse']
li= animal
// will render unordered list of items mentioned in animal arry
ul
each animal, index in ['dog', 'cat', 'mouse']
li #{index + 1}. #{animal}
// renders ordered list
// defining variables
- var animals = {dog: 'Pluto' , cat: 'Pete', mouse: 'Mickey'}
ul
- for name, animal in animals
li #{name}: #{animal}
// while loop
- var length = 100
ul
while length--
li
// define variable and loop through results
- var animals = ['dog', 'cat', 'mouse']
- var length = animals.length
ul
while length--
li=animals[length]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment