Guest User

Untitled

a guest
Nov 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. ```
  2. *{{ a: 1 }} // { a: 1 }
  3. ```
  4.  
  5. ```
  6. *{
  7. ({ a: 1 })
  8. } // { a: 1 }
  9. ```
  10.  
  11. ```
  12. *{ { a: 1 } 5; } // 5
  13. ```
  14.  
  15. ```
  16. *{
  17. let x = 5;
  18. { a: 1 }
  19. } // 5
  20. ```
  21.  
  22. ```
  23. *{
  24. for (var i=0; i<2; ++i) i;
  25. } // 1
  26. ```
  27.  
  28. ```
  29. *{
  30. a:
  31. while (true) {
  32. break a;
  33. }
  34. 5;
  35. } // 5
  36. ```
  37.  
  38. ```
  39. *{
  40. var a = true;
  41. if (a) 1;
  42. else 2;
  43. } // 1
  44. ```
  45.  
  46. ```
  47. *{
  48. var a = true;
  49. if (a) yield 1;
  50. else yield 2;
  51. } // [1]
  52. ```
  53.  
  54. ```
  55. *{
  56. yield null;
  57. } // [null]
  58. ```
  59.  
  60. ```
  61. *{
  62. const identity = (i) => { return i; }
  63. for (var i=0; i<5; ++i) {
  64. yield identity(i);
  65. }
  66. } // [0, 1, 2, 3, 4]
  67. ```
  68.  
  69. ```
  70. *{
  71. for (var i=0; i<5; ++i) {
  72. if (i === 2) continue;
  73. yield identity(i);
  74. }
  75. } // [0, 1, 2, 3, 4]
  76. ```
  77.  
  78. ```
  79. *{
  80. a:
  81. for (var i=0; i<5; ++i) {
  82. for (var j=20; j<25; ++j) {
  83. if (j === 21) {
  84. continue a;
  85. }
  86. yield i + ' ' + j
  87. }
  88. } // [0 20, 1 20, 2 20, 3 20, 4 20]
  89. }
  90. ```
  91.  
  92. ```
  93. *{
  94. break;
  95. } // error
  96. ```
  97.  
  98. ```
  99. *{
  100. return;
  101. } // error
  102. ```
  103.  
  104.  
  105. ```
  106. *{
  107. continue;
  108. } // error
  109. ```
  110.  
  111. ```
  112. <div *{...{a:1}} /> // error
  113. ```
  114.  
  115. ```
  116. *{
  117. () => 1
  118. } // () => 1
  119. ```
  120.  
  121. ```
  122. *{
  123. function *() { 1; }
  124. } // function* () { 1; }
  125. ```
  126.  
  127. ```
  128. *{
  129. class foo {}
  130. } // class foo {}
  131. ```
  132.  
  133. ```
  134. *{[1]} // [1]
  135. ```
Add Comment
Please, Sign In to add comment