41 lines
No EOL
3.9 KiB
Text
41 lines
No EOL
3.9 KiB
Text
<span class="hljs-keyword">let</span> i = <span class="hljs-number">14</span>;
|
|
<span class="hljs-keyword">let</span> i = <span class="hljs-number">(-14)</span>;
|
|
<span class="hljs-keyword">let</span> i = <span class="hljs-number">1000</span>;
|
|
<span class="hljs-keyword">let</span> i = <span class="hljs-number">0b100</span>;
|
|
<span class="hljs-keyword">let</span> i = <span class="hljs-number">0x1FF</span>;
|
|
<span class="hljs-keyword">let</span> i = <span class="hljs-number">0o777</span>;
|
|
<span class="hljs-keyword">let</span> i64 = <span class="hljs-number">128L</span>;
|
|
<span class="hljs-keyword">let</span> i64 = <span class="hljs-number">0b10L</span>;
|
|
<span class="hljs-keyword">let</span> i32 = <span class="hljs-number">32l</span>;
|
|
<span class="hljs-keyword">let</span> i32 = <span class="hljs-number">0x12l</span>;
|
|
<span class="hljs-keyword">let</span> nat = <span class="hljs-number">10n</span>;
|
|
<span class="hljs-keyword">let</span> nat = <span class="hljs-number">0o644n</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">5.</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">5.1</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">1e+1</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">1e1</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">1e-1</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">1024e12</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">1L</span>;
|
|
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">23.0</span><span class="hljs-operator"> +. </span><span class="hljs-number">1.0</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">2</span><span class="hljs-operator"> / </span><span class="hljs-number">23</span><span class="hljs-operator"> * </span><span class="hljs-number">1</span>;
|
|
<span class="hljs-keyword">let</span> f = <span class="hljs-number">2.0</span><span class="hljs-operator"> /. </span><span class="hljs-number">23.0</span><span class="hljs-operator"> *. </span><span class="hljs-number">1.0</span>;
|
|
<span class="hljs-keyword">let</span> exp = <span class="hljs-number">2.0</span><span class="hljs-operator"> ** </span><span class="hljs-number">2.0</span>;
|
|
|
|
<span class="hljs-keyword">let</span> structual = <span class="hljs-literal">true</span><span class="hljs-operator"> == </span><span class="hljs-literal">false</span>;
|
|
<span class="hljs-keyword">let</span> reference = <span class="hljs-literal">true</span><span class="hljs-operator"> === </span><span class="hljs-literal">false</span>;
|
|
|
|
<span class="hljs-keyword">let</span> b = <span class="hljs-literal">true</span><span class="hljs-operator"> || </span><span class="hljs-literal">false</span>;
|
|
<span class="hljs-keyword">let</span> l = <span class="hljs-literal">[]</span>;
|
|
<span class="hljs-keyword">let</span> a = <span class="hljs-literal">[||]</span>;
|
|
<span class="hljs-keyword">let</span> arr = <span class="hljs-literal">[|<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>|]</span>;
|
|
<span class="hljs-keyword">let</span> b = <span class="hljs-literal">[<span class="hljs-identifier">item1</span>, <span class="hljs-identifier">item2</span>, <span class="hljs-operator">...</span><span class="hljs-identifier">theRest</span>]</span>;
|
|
<span class="hljs-keyword">let</span> <span class="hljs-literal">()</span> = ignore(b);
|
|
|
|
<span class="hljs-keyword">let</span> str = <span class="hljs-string">"a"</span><span class="hljs-operator"> ++ </span><span class="hljs-string">"b"</span>;
|
|
|
|
<span class="hljs-keyword">let</span> c = <span class="hljs-character">'a'</span>;
|
|
<span class="hljs-keyword">let</span> c = <span class="hljs-character">'\xFF'</span>;
|
|
<span class="hljs-keyword">let</span> c = <span class="hljs-character">'\128'</span>;
|
|
<span class="hljs-keyword">let</span> c = <span class="hljs-character">'\n'</span>; |