Skip to content

Commit 833c8ef

Browse files
committed
Include for in snippet #3
1 parent 3036dea commit 833c8ef

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ ${1:myArray}.forEach(function (${2:elem}) {
167167
});
168168
```
169169
170+
### [fi] for in
171+
172+
```javascript
173+
for (var ${1:prop} in ${1:obj}) {
174+
if (${1:obj}.hasOwnProperty(${1:prop})) {
175+
${3:// body...}
176+
}
177+
}
178+
```
179+
170180
## Function
171181
172182
### [fu] function

for-in.sublime-snippet

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<snippet>
2+
<content><![CDATA[
3+
for (var ${1:prop} in ${2:obj}) {
4+
if (${2:obj}.hasOwnProperty(${1:prop})) {
5+
${3:// body...}
6+
}
7+
}
8+
]]></content>
9+
<tabTrigger>fi</tabTrigger>
10+
<scope>source.js</scope>
11+
<description>for in</description>
12+
</snippet>

0 commit comments

Comments
 (0)