This way of doing inheritance is taken from JS Objects: Deconstruction.
Also check the slides of The four layers of JavaScript OOP.
| function *fibonacci(n) { | |
| const infinite = !n && n !== 0; | |
| let current = 0; | |
| let next = 1; | |
| while (infinite || n--) { | |
| yield current; | |
| [current, next] = [next, current + next]; | |
| } | |
| } |
| var rngstate; | |
| function MathRandom() { | |
| // Our own implementation of Math.random(). | |
| // Source code was copied from https://github.com/v8/v8/blob/4.6.85/src/math.js#L131 | |
| // You need to initialize rngstate with `solve` before this can be used. | |
| // If using node.js, you have to s/18030/18273/g here and in `solve` since they implement it slightly differently: https://github.com/nodejs/node-v0.x-archive/blob/d13d7f74d794340ac5e126cfb4ce507fe0f803d5/deps/v8/src/math.js#L146 | |
| console.assert(rngstate, "You need to set the global variable `rngstate` first. For example: `rngstate = solve(Math.random(), Math.random());`"); | |
| if (!rngstate) return; | |
| var r0 = (Math.imul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0; | |
| rngstate[0] = r0; |
| The MIT License (MIT) | |
| Copyright (c) 2015 Justin Perry | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| this software and associated documentation files (the "Software"), to deal in | |
| the Software without restriction, including without limitation the rights to | |
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| the Software, and to permit persons to whom the Software is furnished to do so, | |
| subject to the following conditions: |
This way of doing inheritance is taken from JS Objects: Deconstruction.
Also check the slides of The four layers of JavaScript OOP.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| /* CSS */ | |
| With argument | |
| "C:\Program Files\Git\git-bash.exe" "--cd=%1" | |
| Direct | |
| "C:\Program Files\Git\git-bash.exe" "--cd="C:\YOUR\FOLDER\" |
| var OFF = 0, WARN = 1, ERROR = 2; | |
| module.exports = exports = { | |
| "env": { | |
| "es6": true | |
| }, | |
| "ecmaFeatures": { | |
| // env=es6 doesn't include modules, which we are using | |
| "modules": true |
##CSS Методологии, от О до Б
CSS методологии на 1 примере https://github.com/aiboy/CSSM
Слайды https://wsd.events/2016/10/01/pres/css-methodologies.pdf
###CSS Design patterns