Created
August 18, 2015 21:03
-
-
Save Siyanda/e9831934c6a9e2ae941a to your computer and use it in GitHub Desktop.
Some helpful Jade syntax stuffs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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