Skip to content

Commit

Permalink
fixed chuanxshi#56 added note
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanxshi committed Jun 24, 2013
1 parent bd76e07 commit 60482cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions function-patterns/memoization.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@

// preferred method 2
// multiple arguments using JSON stringify

// this will only work correctly for primitive (and Array) arguments,
// since the order in which properties of Objects are enumerated is undetermined
// and can even change between enumerations.
// (a JSON encoder that sorts the keys won't have this issue).

var myFunc = function () {
var cachekey = JSON.stringify(Array.prototype.slice.call(arguments)),
Expand Down

0 comments on commit 60482cb

Please sign in to comment.