-
ArrayBinding
restElementmust be BindingIdentifier ornullexcept when ArrayBinding is part of an AssignmentPattern
-
BindingIdentifier
namemust match the ES6 IdentifierName lexical grammar except whennameis"*default*"and BindingIdentifier is thenameof a ClassDeclaration or FunctionDeclaration which is thebodyof an ExportDefaultnamemust not be a reserved wordnamemust not be a future reserved word in strict mode
-
(12.1.1 and 12.14.5.1 and 14.1.2 and 14.4.1)
namemust not be a restricted word in strict mode
This file contains hidden or 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
| module Main where | |
| --data Language = English | Spanish | |
| --data Censored = Censored | NotCensored | |
| --data Encoding = Plain | EncodingA | EncodingB | |
| data English | |
| data Spanish | |
| data Censored |
This file contains hidden or 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
| var set = new Set([0, 1]), | |
| f = function(x) { return 1 / x; }, | |
| g = function(x) { return x ? -0 : x; }; | |
| set.map(g); // Set{0} | |
| set.map(g).map(f); // Set{1/0} | |
| set.map(function(x){ return f(g(x)); }); // Set{1/0, -1/0} |
This file contains hidden or 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
| function Container(val) { | |
| this.val = val | |
| } | |
| // Functor's `fmap` in Haskell | |
| Container.prototype.map = function(f) { | |
| return new Container(f(this.val)); | |
| }; | |
| // Monad's `>>=` (pronounced bind) in Haskell |
This file contains hidden or 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
| /** | |
| * Proof of concept ESLint rule for warning about potential | |
| * XSS vulnerabilities caused by mixing innerHTML/text node | |
| * property access. | |
| * | |
| * More here: http://benv.ca/2012/10/2/you-are-probably-misusing-DOM-text-methods/ | |
| */ | |
| 'use strict'; | |
| var WARNING_MSG = |
This file contains hidden or 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
| import Data.Char | |
| import Data.Word | |
| import Data.Bits | |
| import Data.List | |
| import Data.Maybe | |
| import qualified Data.ByteString as B | |
| import Codec.Crypto.AES | |
| repeatedKeyXor = do |
This file contains hidden or 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
| import Data.List (unfoldr) | |
| import Data.Tuple (swap) | |
| import System.IO (hSetBuffering, stdout, BufferMode(..)) | |
| placeValues base = reverse . unfoldr (\x -> if x == 0 then Nothing else Just $ swap $ divMod x base) | |
| persistencePath base x = if x < base then [x] else x : (persistencePath base $ product $ placeValues base x) | |
| persistence base n = length (persistencePath base n) - 1 | |
| lowestNumberSuchThat f = head $ dropWhile (not . f) [0..] | |
| main = do |
This file contains hidden or 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
| masksOfLength x = iterate (\y -> map (True:) y ++ map (False:) y) [[]] !! x |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Github Screenshots | |
| // @description make a github repo presentable for screenshots | |
| // @match https://github.com/* | |
| // @version 0.0.1 | |
| // ==/UserScript== | |
| function hide (node) { | |
| node.style.display = 'none'; | |
| } |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| <style> | |
| .meter { | |
| width: 300px; | |
| height: 50px; | |
| border: 1px solid #666; | |
| position: relative; |