Last active
August 29, 2015 14:23
-
-
Save iandanforth/bb87bc11ce9bdc704527 to your computer and use it in GitHub Desktop.
Sublime Snippet: JavaScript functional equivalent of Python's dict.iteritems() or dict.items()
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
| <snippet> | |
| <content><![CDATA[for (var ${20:key} in ${1:Thing}) { | |
| if (${1:Thing}.hasOwnProperty(${20:key})) { | |
| var ${300:val} = ${1:Thing}[${20:key}]; | |
| ${4000} | |
| } | |
| };]]></content> | |
| <tabTrigger>for</tabTrigger> | |
| <scope>source.js</scope> | |
| <description>for key, val in object</description> | |
| </snippet> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation:
Save to <path/to>/Packages/User dir
Should be available immediately within .js files.
Use:
Default example: