-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add frequently-used javascript snippet
- Loading branch information
凌云
committed
Aug 28, 2017
1 parent
2948a95
commit dea4e48
Showing
24 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[concat(${1:array1})]]></content> | ||
<tabTrigger>concat</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>add array</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[join(${1:separator})]]></content> | ||
<tabTrigger>join</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>array to string</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[pop()]]></content> | ||
<tabTrigger>pop</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>remove last</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[push(${1:tmpData})]]></content> | ||
<tabTrigger>push</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>add to last</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[shift()]]></content> | ||
<tabTrigger>shift</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>remove first</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[slice(${1:startIndex}, ${2:endIndex})]]></content> | ||
<tabTrigger>slice</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>subArray</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[splice(${1:startIndex}, ${2:removeNum})]]></content> | ||
<tabTrigger>splice</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>remove item</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[unshift(${1:tmpData})]]></content> | ||
<tabTrigger>unshift</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>add to first</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<snippet> | ||
<content><![CDATA[parseInt(${1:str})]]></content> | ||
<tabTrigger>parseInt</tabTrigger> | ||
<scope>source.js</scope> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[JSON.parse(${1:str})]]></content> | ||
<tabTrigger>JSON.parse</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>string to object</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[JSON.stringify(${1:object})]]></content> | ||
<tabTrigger>JSON.stringify</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>object to string</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[Math.abs(${1:value})]]></content> | ||
<tabTrigger>Math.abs</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>Math.abs</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[Math.ceil(${1:value})]]></content> | ||
<tabTrigger>Math.ceil</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>larger integer</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[Math.floor(${1:value})]]></content> | ||
<tabTrigger>Math.floor</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>smaller integer</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<snippet> | ||
<content><![CDATA[Math.max(${1:x}, ${2:y})]]></content> | ||
<tabTrigger>Math.max</tabTrigger> | ||
<scope>source.js</scope> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<snippet> | ||
<content><![CDATA[Math.min(${1:x}, ${2:y})]]></content> | ||
<tabTrigger>Math.min</tabTrigger> | ||
<scope>source.js</scope> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[Math.round(${1:value})]]></content> | ||
<tabTrigger>Math.round</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>Math.round</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[lastIndexOf(${1:searchvalue}, ${2:fromindex})]]></content> | ||
<tabTrigger>lastIndexOf</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>lastIndexOf char</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[charAt(${1:index})]]></content> | ||
<tabTrigger>charAt</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>charAt index</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[indexOf(${1:searchvalue}, ${2:fromindex})]]></content> | ||
<tabTrigger>indexOf</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>indexOf char</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[slice(${1:start}, ${2:end})]]></content> | ||
<tabTrigger>slice</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>sub string</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[split(${1:separator}, ${2:howmany})]]></content> | ||
<tabTrigger>split</tabTrigger> | ||
<scope>source.js</scope> | ||
<description>split</description> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<snippet> | ||
<content><![CDATA[toLowerCase()]]></content> | ||
<tabTrigger>toLowerCase</tabTrigger> | ||
<scope>source.js</scope> | ||
</snippet> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<snippet> | ||
<content><![CDATA[toUpperCase()]]></content> | ||
<tabTrigger>toUpperCase</tabTrigger> | ||
<scope>source.js</scope> | ||
</snippet> |