mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-19 05:31:21 +08:00
feat: add vim.md
regex.md
cheatsheet. 9ff36a3ac3
This commit is contained in:
466
docs/json.html
466
docs/json.html
@ -40,11 +40,11 @@
|
||||
</div></div><div class="h2wrap-body"><div class="wrap"><div class="wrap-header h3wrap"><h3 id="介绍"><a aria-hidden="true" tabindex="-1" href="#介绍"><span class="icon icon-link"></span></a>介绍</h3><div class="wrap-body">
|
||||
<p><a href="https://json.org/">JSON</a> 是一种基于文本的轻量级开放标准,专为人类可读的数据交换而设计。</p>
|
||||
<ul>
|
||||
<li>JSON 代表 JavaScript 对象表示法</li>
|
||||
<li>JSON 易于读写。</li>
|
||||
<li>JSON 是与语言无关的数据交换格式</li>
|
||||
<li>JSON 文件扩展名为 <code>.json</code></li>
|
||||
<li>JSON Internet 媒体类型为 <code>application/json</code></li>
|
||||
<li>JSON 代表 JavaScript 对象表示法</li>
|
||||
<li>JSON 易于读写。</li>
|
||||
<li>JSON 是与语言无关的数据交换格式</li>
|
||||
<li>JSON 文件扩展名为 <code>.json</code></li>
|
||||
<li>JSON Internet 媒体类型为 <code>application/json</code></li>
|
||||
</ul>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="示例"><a aria-hidden="true" tabindex="-1" href="#示例"><span class="icon icon-link"></span></a>示例</h3><div class="wrap-body">
|
||||
<pre class="language-json"><code class="language-json code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">{</span>
|
||||
@ -61,91 +61,92 @@
|
||||
</span><span class="code-line line-number" line="12"><span class="token punctuation">}</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="类型"><a aria-hidden="true" tabindex="-1" href="#类型"><span class="icon icon-link"></span></a>类型</h3><div class="wrap-body">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>描述</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>Number</code></td>
|
||||
<td>双精度浮点</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>String</code></td>
|
||||
<td>字符系列</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Boolean</code></td>
|
||||
<td>“true”或“false”</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Array</code></td>
|
||||
<td>有序的值序列</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Value</code></td>
|
||||
<td>字符串、数字、布尔值、空值等</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Object</code></td>
|
||||
<td>键/值对的无序集合</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>null</code></td>
|
||||
<td>Null 或 Empty</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div></div><div class="wrap" style="grid-row: span 3/span 3;"><div class="wrap-header h3wrap"><h3 id="字符串"><a aria-hidden="true" tabindex="-1" href="#字符串"><span class="icon icon-link"></span></a>字符串</h3><div class="wrap-body"><!--rehype:wrap-style=grid-row: span 3/span 3;-->
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>\"</code></td>
|
||||
<td>双引号 Double quote</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\\</code></td>
|
||||
<td>反斜杠 Backslash</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\/</code></td>
|
||||
<td>正斜杠 Forward slash</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\b</code></td>
|
||||
<td>退格 Backspace</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\f</code></td>
|
||||
<td>换页 Form feed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\n</code></td>
|
||||
<td>换行 Newline</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\r</code></td>
|
||||
<td>回车 Carriage return</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\t</code></td>
|
||||
<td>标签 Tab</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>\u</code></td>
|
||||
<td>后跟四个十六进制数字</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th>类型</th><th>描述</th></tr></thead><tbody><tr><td><code>Number</code></td><td>双精度浮点</td></tr><tr><td><code>String</code></td><td>字符系列</td></tr><tr><td><code>Boolean</code></td><td>“true”或“false”</td></tr><tr><td><code>Array</code></td><td>有序的值序列</td></tr><tr><td><code>Value</code></td><td>字符串、数字、布尔值、空值等</td></tr><tr><td><code>Object</code></td><td>键/值对的无序集合</td></tr><tr><td><code>null</code></td><td>Null 或 Empty</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap" style="grid-row: span 3/span 3;"><div class="wrap-header h3wrap"><h3 id="字符串"><a aria-hidden="true" tabindex="-1" href="#字符串"><span class="icon icon-link"></span></a>字符串</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-style=grid-row: span 3/span 3;-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><code>\"</code></td><td>双引号 Double quote</td></tr><tr><td><code>\\</code></td><td>反斜杠 Backslash</td></tr><tr><td><code>\/</code></td><td>正斜杠 Forward slash</td></tr><tr><td><code>\b</code></td><td>退格 Backspace</td></tr><tr><td><code>\f</code></td><td>换页 Form feed</td></tr><tr><td><code>\n</code></td><td>换行 Newline</td></tr><tr><td><code>\r</code></td><td>回车 Carriage return</td></tr><tr><td><code>\t</code></td><td>标签 Tab</td></tr><tr><td><code>\u</code></td><td>后跟四个十六进制数字</td></tr></tbody></table>
|
||||
</div></div><div class="h3wrap-body"><div class="wrap"><div class="wrap-header h4wrap"><h4 id="示例-1"><a aria-hidden="true" tabindex="-1" href="#示例-1"><span class="icon icon-link"></span></a>示例</h4><div class="wrap-body">
|
||||
<pre class="language-json"><code class="language-json code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">{</span>
|
||||
</span><span class="code-line line-number" line="2"> <span class="token property">"url"</span><span class="token operator">:</span> <span class="token string">"https://quickref.me"</span><span class="token punctuation">,</span>
|
||||
@ -157,29 +158,31 @@
|
||||
<pre class="language-json"><code class="language-json code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">{</span> <span class="token property">"foo"</span><span class="token operator">:</span> 'bar' <span class="token punctuation">}</span>
|
||||
</span></code></pre>
|
||||
<p>Have to be delimited by double quotes</p>
|
||||
</div></div></div></div></div><div class="wrap row-span-2"><div class="wrap-header h3wrap"><h3 id="数字"><a aria-hidden="true" tabindex="-1" href="#数字"><span class="icon icon-link"></span></a>数字</h3><div class="wrap-body"><!--rehype:wrap-class=row-span-2-->
|
||||
<table class="show-header ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>Integer</code></td>
|
||||
<td>数字 1-9、0 和正数或负数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Fraction</code></td>
|
||||
<td>0.3、3.9 等分数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Exponent</code></td>
|
||||
<td>指数,如 e、e+、e-、E、E+、E</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><!--rehype:className=show-header -->
|
||||
</div></div></div></div></div><div class="wrap row-span-2"><div class="wrap-header h3wrap"><h3 id="数字"><a aria-hidden="true" tabindex="-1" href="#数字"><span class="icon icon-link"></span></a>数字</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table class="show-header "><thead><tr><th>类型</th><th>说明</th></tr></thead><tbody><tr><td><code>Integer</code></td><td>数字 1-9、0 和正数或负数</td></tr><tr><td><code>Fraction</code></td><td>0.3、3.9 等分数</td></tr><tr><td><code>Exponent</code></td><td>指数,如 e、e+、e-、E、E+、E</td></tr></tbody></table>
|
||||
<!--rehype:className=show-header -->
|
||||
</div></div><div class="h3wrap-body"><div class="wrap"><div class="wrap-header h4wrap"><h4 id="示例-2"><a aria-hidden="true" tabindex="-1" href="#示例-2"><span class="icon icon-link"></span></a>示例</h4><div class="wrap-body">
|
||||
<pre class="language-json"><code class="language-json code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">{</span>
|
||||
</span><span class="code-line line-number" line="2"> <span class="token property">"positive"</span> <span class="token operator">:</span> <span class="token number">12</span><span class="token punctuation">,</span>
|
||||
@ -272,37 +275,38 @@
|
||||
</span><span class="code-line line-number" line="8"><span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
</span></code></pre>
|
||||
<hr>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>myObject.name</code></td>
|
||||
<td>"Jason"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject["name"]</code></td>
|
||||
<td>"Jason"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject.age</code></td>
|
||||
<td>39</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject.other</code></td>
|
||||
<td>undefined</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject[0]</code></td>
|
||||
<td>undefined</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div></div><div class="wrap" style="grid-row: span 2/span 2;"><div class="wrap-header h3wrap"><h3 id="访问嵌套"><a aria-hidden="true" tabindex="-1" href="#访问嵌套"><span class="icon icon-link"></span></a>访问嵌套</h3><div class="wrap-body"><!--rehype:wrap-style=grid-row: span 2/span 2;-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><code>myObject.name</code></td><td>"Jason"</td></tr><tr><td><code>myObject["name"]</code></td><td>"Jason"</td></tr><tr><td><code>myObject.age</code></td><td>39</td></tr><tr><td><code>myObject.other</code></td><td>undefined</td></tr><tr><td><code>myObject[0]</code></td><td>undefined</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap" style="grid-row: span 2/span 2;"><div class="wrap-header h3wrap"><h3 id="访问嵌套"><a aria-hidden="true" tabindex="-1" href="#访问嵌套"><span class="icon icon-link"></span></a>访问嵌套</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-style=grid-row: span 2/span 2;-->
|
||||
<pre class="language-javascript"><code class="language-javascript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">let</span> myObject <span class="token operator">=</span> <span class="token punctuation">{</span>
|
||||
</span><span class="code-line line-number" line="2"> <span class="token string-property property">"ref"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
</span><span class="code-line line-number" line="3"> <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
|
||||
@ -331,37 +335,38 @@
|
||||
</span><span class="code-line line-number" line="26"><span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
</span></code></pre>
|
||||
<hr>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>myObject.ref.age</code></td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject["ref"]["age"]</code></td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject.jdoe</code></td>
|
||||
<td>["Jason", "Doe", 39 ...]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject.jsmith[3]</code></td>
|
||||
<td>"F"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myObject[1]</code></td>
|
||||
<td>undefined</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div></div><div class="wrap" style="grid-row: span 2/span 2;"><div class="wrap-header h3wrap"><h3 id="访问对象数组"><a aria-hidden="true" tabindex="-1" href="#访问对象数组"><span class="icon icon-link"></span></a>访问对象数组</h3><div class="wrap-body"><!--rehype:wrap-style=grid-row: span 2/span 2;-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><code>myObject.ref.age</code></td><td>2</td></tr><tr><td><code>myObject["ref"]["age"]</code></td><td>2</td></tr><tr><td><code>myObject.jdoe</code></td><td>["Jason", "Doe", 39 ...]</td></tr><tr><td><code>myObject.jsmith[3]</code></td><td>"F"</td></tr><tr><td><code>myObject[1]</code></td><td>undefined</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap" style="grid-row: span 2/span 2;"><div class="wrap-header h3wrap"><h3 id="访问对象数组"><a aria-hidden="true" tabindex="-1" href="#访问对象数组"><span class="icon icon-link"></span></a>访问对象数组</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-style=grid-row: span 2/span 2;-->
|
||||
<pre class="language-javascript"><code class="language-javascript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">let</span> myArray <span class="token operator">=</span> <span class="token punctuation">[</span>
|
||||
</span><span class="code-line line-number" line="2"> <span class="token punctuation">{</span>
|
||||
</span><span class="code-line line-number" line="3"> <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"Jason"</span><span class="token punctuation">,</span>
|
||||
@ -390,36 +395,36 @@
|
||||
</span><span class="code-line line-number" line="26"><span class="token punctuation">]</span><span class="token punctuation">;</span>
|
||||
</span></code></pre>
|
||||
<hr>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>myArray[0]</code></td>
|
||||
<td><code>{</code>"name": "Jason", ...<code>}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myArray[1].name</code></td>
|
||||
<td>"Tom"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myArray[1][2]</code></td>
|
||||
<td>42</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myArray[3]</code></td>
|
||||
<td>undefined</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myArray[3].gender</code></td>
|
||||
<td>TypeError: Cannot read...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><code>myArray[0]</code></td><td><code>{</code>"name": "Jason", ...<code>}</code></td></tr><tr><td><code>myArray[1].name</code></td><td>"Tom"</td></tr><tr><td><code>myArray[1][2]</code></td><td>42</td></tr><tr><td><code>myArray[3]</code></td><td>undefined</td></tr><tr><td><code>myArray[3].gender</code></td><td>TypeError: Cannot read...</td></tr></tbody></table>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="访问阵列"><a aria-hidden="true" tabindex="-1" href="#访问阵列"><span class="icon icon-link"></span></a>访问阵列</h3><div class="wrap-body">
|
||||
<pre class="language-javascript"><code class="language-javascript code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">let</span> myArray <span class="token operator">=</span> <span class="token punctuation">[</span>
|
||||
</span><span class="code-line line-number" line="2"> <span class="token string">"Jason"</span><span class="token punctuation">,</span>
|
||||
@ -431,34 +436,33 @@
|
||||
</span><span class="code-line line-number" line="8"><span class="token punctuation">]</span><span class="token punctuation">;</span>
|
||||
</span></code></pre>
|
||||
<hr>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>myArray[1]</code></td>
|
||||
<td>"Doe"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myArray[5]</code></td>
|
||||
<td>true</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>myArray[6]</code></td>
|
||||
<td>undefined</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><code>myArray[1]</code></td><td>"Doe"</td></tr><tr><td><code>myArray[5]</code></td><td>true</td></tr><tr><td><code>myArray[6]</code></td><td>undefined</td></tr></tbody></table>
|
||||
</div></div></div></div></div><div class="wrap"><div class="wrap-header h2wrap"><h2 id="另见"><a aria-hidden="true" tabindex="-1" href="#另见"><span class="icon icon-link"></span></a>另见</h2><div class="wrap-body">
|
||||
<ul>
|
||||
<li><a href="https://www.json.org/json-en.html">JSON</a> <em>(json.org)</em></li>
|
||||
<li><a href="http://jsoneditoronline.org/">JSON Editor Online</a> <em>(jsoneditoronline.org)</em></li>
|
||||
<li><a href="https://tableconvert.com/json-to-markdown">Convert JSON Array to Markdown Table, CSV and more</a> <em>(tableconvert.com)</em></li>
|
||||
<li><a href="https://www.json.org/json-en.html">JSON</a> <em>(json.org)</em></li>
|
||||
<li><a href="http://jsoneditoronline.org/">JSON Editor Online</a> <em>(jsoneditoronline.org)</em></li>
|
||||
<li><a href="https://tableconvert.com/json-to-markdown">Convert JSON Array to Markdown Table, CSV and more</a> <em>(tableconvert.com)</em></li>
|
||||
</ul>
|
||||
|
||||
</div></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang, All rights reserved.</footer></footer></body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user