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 withdraw(address token, uint256 amount) returns (bool success) { | |
| if (safeSub(block.number, lastActiveTransaction[msg.sender]) < inactivityReleasePeriod) throw; | |
| ... | |
| } |
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 buildPatternTable(pattern) { | |
| const fault = Array(pattern.length).fill(0); | |
| let j = 0; | |
| let i = 1; | |
| while (i < pattern.length || j !== 0) { | |
| if (pattern[i] === pattern[j]) { | |
| fault[i] = j + 1; | |
| j++; | |
| } else if (j > 0) { | |
| j = fault[j - 1]; |
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 appInsights = window.appInsights; | |
| if (appInsights && appInsights.queue) { | |
| function adjustPageName(item) { | |
| var name = item.name.replace("AppName", ""); | |
| if (name.indexOf("Order") !== -1) | |
| return "Order"; | |
| if (name.indexOf("Product") !== -1) |
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 result = (function(a) { | |
| return a*a; | |
| }(5.5)); | |
| console.log(result); |
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
| const b = [1, 2, 3]; | |
| const f = (a, ...b) => a + b; | |
| console.log(f(1)); |
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
| let f = (...f) => f; | |
| console.log(f(10)); | |
| f = (...f) => f.reduce(f => f); | |
| console.log(f(10)); | |
| function ff() { | |
| return arguments; | |
| } | |
| console.log(ff(10)); |
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 foo = 10; | |
| bar = 3; | |
| (function () { | |
| var foo = 2; | |
| bar = 1; | |
| }()) | |
| bar = bar + foo; | |
| console.log(bar); |
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 x = 5; | |
| (function () { | |
| console.log(x); | |
| var x = 10; | |
| console.log(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
| var x = 5; | |
| (function () { | |
| var x; | |
| console.log(x); | |
| x = 10; | |
| console.log(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
| (function(){ | |
| var a = b = 3; | |
| })(); | |
| console.log(typeof a); | |
| console.log(typeof b); |