raganwald / allong.es Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://leanpub.com/javascriptallongesix
Home Page: https://leanpub.com/javascriptallongesix
fold, unfold, map, accumulate, accumulateWithReturn, unfoldWithReturn, take, drop, slice
Time to update the url: http://www.allong.es/
Shuffle should swap rather than remove, e.g. http://www.2ality.com/2013/03/permutations.html
I would love an all-in-one decorator utility function that I can use to wrap jQuery with. I've attempted to write such a utility in my own project devinrhode2/extendFunction.js, but this doesn't successfully wrap jQuery. One guess I have is that jQuery.prototype.init itself has a prototype that I need to also copy over into the decorated function. I have accomplished my goals via a hack, but what I'm seeking is the holy grail all in one decorator utility, which I can use to decorate any javascript function or class (or hybrid function+object+class Frankenstein that is jQuery)
(ps I found this project by searching lodash for "decorator" https://github.com/lodash/lodash/search?q=decorator&type=Issues)
For instance:
var fruits = [
{ name: 'orange', colour: 'orange' },
{ name: 'banana', colour: 'yellow' }
];
get(fruits[0], function() {
if (whatever) {return 'colour';}
});
// Results: 'orange' or undefined
Or am I thinking about this the wrong way? Where I should instead look at using filter/filterWith to achieve something similar?
I am asking because I seem to want to do the same thing with pluck/pluckWith (ie: pluck arbitrary properties).
The build provided uses require('promise')
which does not work out of the box in the browser.
on page 210 a game is initialized with the following:
this.size = size ? Math.floor(Math.random() * 8) + 8 : size;
however, if size is null it is trying to create Game with null size. Therefore, the code should read like this:
this.size = size ? size : Math.floor(Math.random() * 8) + 8;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.