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 Constans(arg, value) { | |
| return Object.defineProperty(this, arg, { | |
| value: value, | |
| writable: false | |
| }); | |
| } | |
| Constans('test', 2); | |
| test; //2 |
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 makeIterator(arr) { | |
| var index = 0; | |
| return { | |
| next : function() { | |
| return index < arr.length ? { | |
| value: arr[index++], | |
| done: false | |
| } : { | |
| value: arr[index], | |
| done: true |
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 lang="5"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Pierwszy komponent w React.js</title> | |
| <script src="https://unpkg.com/react/umd/react.development.js"></script> | |
| <script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script> | |
| <script src="https://unpkg.com/babel-standalone/babel.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css"> | |
| </head> |
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 lang="5"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Pierwszy komponent w React.js</title> | |
| <script src="https://unpkg.com/react/umd/react.development.js"></script> | |
| <script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script> | |
| <script src="https://unpkg.com/babel-standalone/babel.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css"> | |
| </head> |
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
| Array.prototype.map2 = function(fn) { | |
| this.forEach(function(e) { | |
| fn.call(this,e); | |
| }); | |
| } |
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 R = {}; | |
| R.component = function() { console.log('hello') }; | |
| var A = { component } = R; |
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
| Object.prototype.parasiteCopy = function(obj, args) { | |
| if(typeof obj.constructor === 'function') { | |
| obj.apply(this, args); | |
| } | |
| } | |
| var Plant = function(colour,roots) { | |
| this.colour = colour; | |
| this.roots = roots | |
| } |
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
| Object.prototype.mixin = function(obj) { | |
| if(typeof obj === 'object') { | |
| for(let i in obj) { | |
| String(i) in this ? `${i} - property exist` : this[i] = obj[i]; | |
| } | |
| } | |
| } | |
| var Vehicle = { works: true, tank: 100, hasWheels: true } |
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
| /** | |
| * distro. | |
| * @module distro. | |
| * @version 1.0.0 | |
| * | |
| * @author ppraksa | |
| * @copyright (c) 2017 ppraksa. | |
| */ | |
| const distro = {}, |
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 test(...args) { | |
| try { | |
| var cb = args.pop(); | |
| (cb.constructor.name === 'Function') ? null : new Error('isnt fn'); | |
| let a = args, | |
| tmp = 0, | |
| it = a[Symbol.iterator](); | |
| do { | |
| tmp = it.next(); | |
| if(tmp.value != undefined) { |