Elvis: You could also use lookup.hasOwnPropertystr
Drust: I wana look up the msn do***entation on it
Mate: Tcsc: in operator – JavaScript MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in
Elvis: Wasn’t sure that would work.
Vafiadis: IMath: because each exec only gives you one result, you gotta keep calling it until you get “null” to get all of them.
Vafiadis: IMath: you may be looking for str.match, like:
Leffel: We need hasownproperty to avoid iterating through prototypes right?
Mate: IMath: object ’12’, ’34’, ‘5’
Schubbe: If we are just checking if a key exisits , “in” is really cool
Vafiadis: Yeah but you gotta watch out, because “in” walks the prototype chain
Elvis: Zeroquake: sure, i doubt there will be any stringized date in the prototype, but if you want to be careful
Elvis: If you were really paranoid about that, you should probably do Object.prototype.hasOwnProperty.calllookup, str
Lucia: Other than hasOwnProperty there is no way for it to avoid checking on its prototype right
Vafiadis: No way more convenient than hasOwnProperty
Hoffman: Nah , pretty sure prototypes aint gona have any dates in them
Graziani: Mate: you mean what ?
Elvis: I wouldn’t worry about it then.
Elvis: You could create lookup with Object.createnull, which has no prototype, if you wanted.
Vafiadis: IMath: Mate is a bot – I just made it return the results of the sample JS I gave you
Vafiadis: Which gives you all the numbers
Vafiadis: Zeroquake, tcsc: or you could just use hasOwnProperty ;-
Vafiadis: I know it looks less pretty than “in” but it’s a better way to go
Elvis: If you have dates in Object.prototype you have some serious problems
Vafiadis: Though yeah, you could create your dedupuing object with Object.createnull, no reason not to I guess
Elvis: In doesn’t really look pretty when youre negating it though
Elvis: If !foo in bar looks stupid.
Firestine: Hey guys, what’s with the div#id, how do I select it
Vafiadis: Since you’re creating the object with {}, the only way you’d end up with dates is if something polluted Object.prototype
Vafiadis: And if you can’t trust Object.prototype, what can you trust?
Kimbal: Guys, how do I select a dynamic ID.
While: Vafiadis: even a regexp flagged with ‘g’, exec cannot give out all the matched characters out ,right ?
Elvis: I think if you keep calling exec it will
Paulhus: Selectid would be pretty dynamic
Vafiadis: IMath: it will, you just gotta keep calling exec to get each one until the .exec returns null
Elvis: Var re = /d+/g, match, result = ; while match = re.exec’12 34 5′ { result.pushmatch; } result
Mate: Tcsc: object ’12’, ’34’, ‘5’
Mariner: Currently, I’m using a jQuery plugin which will generate an image when the website is load, which I finally managed to set an Id to, but I can’t seem to select it to do actions in html. So when I went into google chrome’s developer tool, and tried editing it, it was something like div#snappuzzlepiece
Escatel: Currently, I’m using a jQuery plugin which will generate an image when the website is load, which I finally managed to set an Id to, but I can’t seem to select it to do actions in html. So when I went into google chrome’s developer tool, and tried editing it, it was something like div#snappuzzlepiece
Doughtie: I can’t seem to ‘select’ the Id in my html script/script code.
Botkin: Vafiadis: so the flag ‘g’ doesn’t work as it mean as usual with .exec
Mate: IMath: string ‘done’; Console: ’12’, ’34’, ‘5’
Vafiadis: The regexp just gives you the matches one at a time
Vafiadis: Without the ‘g’ flag it’d just always give you the first match