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
using System; | |
namespace MyApplication | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Create a new account instance with initial amount. | |
Account acc = new Account(500); |
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
// ES5 | |
var list = []; | |
for (var i =0, len = 500000; i < len; i++) { | |
list.push(i); | |
} | |
console.time("test"); | |
repeater(20, {callback: test1, value: 499999, list: list} ); | |
console.timeEnd("test"); |
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
/** | |
* This class provides a functional to find a point inside a specific figure. | |
* First of all you have to define a figure coordinates. | |
* Then use an appropriate method "check( point )", which will return a result. | |
*/ | |
class PointManager { | |
constructor(setList) { | |
this.setX = []; | |
this.setY = []; |
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 users = [ | |
{Name: "Peter", Age: 30, Id: 1}, | |
{Name: "Bob", Age: 20, Id: 2}, | |
{Name: "Jack", Age: 25, Id: 3} | |
]; | |
class userManager { | |
constructor() { | |
this.getById = (id, callback) => { | |
let result = users.find( (u) => u.Id == id ); |
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 __extends = (this && this.__extends) || function (d, b) { | |
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
function __() { this.constructor = d; } | |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | |
}; | |
// Enumeration to define a Person gender. | |
var Gender; | |
(function (Gender) { | |
Gender[Gender["Male"] = 0] = "Male"; | |
Gender[Gender["Female"] = 1] = "Female"; |
NewerOlder