![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
On Jun 20, 9:21 am, slebetman <slebet... (AT) gmail (DOT) com> wrote: On Jun 20, 2:29 am, VK <schools_r... (AT) yahoo (DOT) com> wrote: snip Of course this piece of knowledge is useless for open Web-wide solutions. Or steal the idea and implement your own Dictionary: But maybe best to steal one written by someone who understands the issues. function Dict (obj) { var that = this; var internalHash = {}; var internalCount = 0; if (obj) { snip that.count = function () { return internalCount; } } var d = new Dict({ this : 1, ^^^^ This, the code and the keyword in this context, is a syntax error. |

|
Now add:- d.remove('constructor'); d.remove('toString'); d.remove('valueOf'); d.remove('isPrototypeOf'); alert(d.count()); // -1 - and observe a significant flaw in that implementaion. |
![]() |
| Thread Tools | |
| Display Modes | |
| |