Paulhus: No friendly bluescreens at all
Paulhus: To round that up, they really do not work in async code in js
Paulhus: I’m not even sure if you can have several catch blocks for different types of exceptions.
Paulhus: And yet it’s better than a function that is expected to return integer values suddenly returns an error. you would need to construct objects that always contain an error code and the desired result value. and still you would have more problems as when using exceptions. i don’t know what the alternative would be.
Elvis: I think of it more as, if you’re doing an operation that might fail, you need to return all the data you might need to know about that operation’s status
Paulhus: Ergo: you need always the status
Elvis: Most functions dont need that though.
Paulhus: And that is what webservices do, because they must.
Reineck: Paulhus: JS catch clause doesn’t filter on exception type
Reineck: It just takes a variable that the exception gets ***igned to
Paulhus: Yep i thought so. while catch is similar to overloading a function
Berdin: Hey , need some ideas, i have array of objects containing dates in millisec arranged in ascending order , i need to find and remove duplicates .duplicates as in dates that convert to the same date in local timezone
Boneta: I think lodash has a util for that
Henggeler: Here duplicates dont have same values , they can vary in seconds but still be of same date
Elvis: Sort them by date, and then run over the array and when you see a new date add it a results array
Vigen: Yah thats a good idea.
Elvis: Fwiw i imagine you could make the lodash utility do that for you if you already have lodash included.
Hipolito: Nopes , cant use lodash in current setup. let me try out your idea
Vafiadis: Or just feed them into an object – use a stringified date with the seconds stripped as the key, and the actual date object if you need to save it in the value
Vafiadis: Then when you convert back, it’ll be deduped
Elvis: Oh, thats probably better actually.
Vafiadis: Or if the date is a property on some bigger object in the collection, you can put that object in the value
Cornette: Has anyone here worked with gulp-rev and sourcemaps? I can see theres some pr’s that seem to manage it in some way, but I’m finding that my comments at the end of files are still pointing at the non rev filename
Ratcliffe: I still need to store these duplicates as i need them later, will use the instance thats left in aray as a key pointer in another objects containing the removed duplicates
Elvis: Yeah, hence making a new deduped array
Elvis: As opposed to modifying the old.
Bad: Will give it a shot , thank you.
Vafiadis: You can trick with a bit of mutation
Moten: Vafiadis, if you strip of seconds , how can you get back original time values in millisecs , you would lose some time
Elvis: Zeroquake: something like http://pastie.org/10422633 would work too.
Vafiadis: Function forkFilterdateArray { var deduped = {}; var dupes = dateArray.filterfunctionval, i { var key = toDtStrval; if deduped.hasOwnPropertykey { return true; } else { dedupedkey = val; return false; }; return {dupes: dupes, deduped: deduped }; }
Vafiadis: Er, though I forgot to convert deduped back into an array
Vafiadis: But that’ll give you both the deduped results AND the dupes you’ve removed
Vafiadis: To get deduped back into an array you can just do Object.keysdeduped.mapfunctionkey { return dedupedkey; }
Vafiadis: That filter implementation breaks my own rules by having a .filter that has side effects but it will achieve the desired result!
Visor: Why /d+/g.exec’12 34 5′ cannot get all the numbers out?
Matlack: Tcsc, “str in lookup” what is “in” refered to as ?
Elvis: It tests if it’s a key in the object