« first day (1640 days earlier)      last day (3309 days later) » 

7:00 PM
new Date(year, month[, day[, hour[, minutes[, seconds[, milliseconds]]]]]);
 
Number takes arguments as well
 
I'm curious when new Number is needed?
same with new String
I've never actually heard of the use cases for them being invoked with new
 
they are the constructor therefore you can make the new statement
i dont think they're used that often unless for challenges
and type check
 
I believe they have overloads that can be useful, like Array.
But most importantly, to make String and Number real classes, they need prototypes, which need to be attached to a constructor, and since JS doesn't have private, you can new them up
 
7:07 PM
hrm
 
that's what I assume, at least
 
Number(1)
1
new Number(1)
Number {[[PrimitiveValue]]: 1}
 
new Number // 0
 
I'll have to look into it more later for real world cases
 
There aren't really many use cases for them, I think they're an implementation side-effect that leaked out
 
7:08 PM
that is what it appears to be for me, but I don't wanna make that assumption
 
lol just found out that you dont need () when you use new
xD
 
@Catgocat because new invokes the objects constructor if one exists
 
cool
but how it invokes a the contructor if
new b; b.constructor // Function; b {}
the objects contructor is always going to be a function
 
function b () {
  // I am the constructor
}
 
or I miss understood u?
 
7:10 PM
JS new is at least 6 different kinds of evil; trying to understand it is useless.
 
yes constructors are always functions
 
oh ok
I hate when ppl say that Javascript is not a real language
 
function b () {
  // I am the walrus
}
 
and that is very easy
>:(
 
it is a real language, it is just a very bad language
 
7:11 PM
//coo coo ca choo
 
I love it. but it is terrible.
 
If JS isn't real, we're all more crazy than we thought.
 
how can JS be real when our constructors are not real.
 
However, it has very little in common with any well-designed, consistent, thought-out language.
 
js is great
 
7:12 PM
@ssube it consistently makes me "wtf"
does that count ?? :P
 
except NaN !== NaN
 
Hello
 
@Azar_Javed Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
js isn't half-assed on purpose, it just forgot to define half its ass
 
do you guys use with ? i've never seen that in production
(I know its not good to use it)
 
7:12 PM
with is an antipattern
I've used it for performance reasons
 
with confuses me (which me depending on how with was used)
 
FF likes to jack up performance on such silly things
 
@Catgocat this is actually one of the few parts of JS that is required by international standards
 
and what were your overall results?
chrome debugger uses with xD
 
the one part of JS you don't like is one of the few parts they did correctly
 
7:13 PM
with(element.style) {
color = 'red';
}
was like 400 million ops, without with was like 10 million ops
caring about such a difference is silly.
 
with (typeof __commandLineAPI !== 'undefined' ? __commandLineAPI : { __proto__: null }) {
aa
}
 
don't ever do that thing you just did
 
@Catgocat consider some of their code is auto generated from abstraction layers
I doubt a real human wrote that
 
with (ternary : fallback is downright mean
 
In eloquent javascript there's an example where you filter an array and you call console.log(filter(ancestry, function(person) {
return person.born > 1900 && person.born < 1925;
}));

How does it know to connect person with entry in ancestry to give you person.birth?
I really don't understand that part, and where it's defined
 
7:15 PM
@Azar_Javed it's just a prettied up for loop
 
it's an Array.filter shim iirc
 
That part i know, but in the for loop where it's explained what it does, he doesn't mention person anywhere
 
foo.filter(bar => !!bar.thing) is equivalent to let r = []; for (let f of foo) { if (f.thing) { r.push(f); } };
 
[1,2,3,4,5].filter(function(arrayItem) { // I assign the values of the array to this variable as I step over it
  return arrayItem < 4
});
@Azar_Javed person is the newly passed argument
 
with({a: "a"}) { this; a}
 
7:17 PM
you define the name
 
Wtf xD
 
@Catgocat with(obj) { obj is now this }
 
no it isnt
check it out
with({a: "a"}) { this; a}
 
:sigh:
sorry, it checks for the property on obj first.
with({a: "a"}) { a } // "a"
 
xD
 
7:19 PM
var foo = { bar: 1 }
with( foo ) {
  bar = 2;
}
foo.bar; // 2
 
It hasOwnProperty, because if I type constructor
 
So it just knows that it is the value in the array that we are currently dealing with
 
it doesn't recognize
Oh it does
my bad
with({a: "a"}) { constructor}
 
@Azar_Javed it is passing the values of the array to your callback function
 
with([1,3,2]) { 0; }
 
7:21 PM
Sorry if I'm not making send, English is not my primary language
sense*
 
I thought with was bad
 
it is
 
porque
 
I understand what happens, I don't understand how/why it works? Is this just a part of javascript
 
it has nothing to do with bacon
 
7:23 PM
lolshutup
 
var array = [
  { person: 'rlemon', income: 1e6 },
  { person: 'Azar', income: 1000 }
];
var filteredArray = array.filter(filterFunction);
console.log(filteredArray);
function filterFunction(arrayItem, arrayIndex) {
  return arrayItem.income > 1000;
}
 
it's all about scoping and predictability
 
I think I have got this right: http://stackoverflow.com/a/29613379/586051
Is there a way to improve it?
 
@Azar_Javed check my example above
see if that makes more sense
 
if the object you're withing up comes from the server and one day somebody updates the server, it may suddenly hide a new variable
 
7:23 PM
@rlemon give me a min to go over it :)
 
and bam, some of your code is effectively coming from the remote server
that's probably bad
 
@SterlingArcher same reason as == vs ===
with makes your code confusing
read: can make
 
afaik other languages that implement 'with' also advise against it
I know I use it in c# as well. but I feel bad about it
 
@rlemon so it's just a way for you to refer to the passing argument of the array while you're working with it? person in my example basically equals to ancestry[i] in the for loop that is ancestry.filter? And it's just part of the language, correct?
 
7:29 PM
using the native method Array.prototype.filter yes
in the example you have he's "shimmed" that feature
so the idea is the same, but the code you write is slightly different.
 
shimmed?
 
shimmy shimmy cocoa puff
 
Why do I have a fear of automation? I'm not talking about robots stealing my job, but the power of the computer instead. Sometimes I would self-sabotage myself and not use a powerful technique (let's say regex) and use something else instead, because of fear. Sometimes I wouldn't use the most advanced features of google maps on purpose, even though I waste time. I know it's irrational, but a fact
 
@Azar_Javed google "shim vs polyfill" it will explain everything
 
Using regex will guarantee the robots never take over.
 
7:31 PM
auto completion gets in my way most of the time
 
@rlemon thank you very much sir
 
I know what I wanna type, when you give me options I second guess myself. however brief
 
why does meteor keep on messing up when I go back to my page? :|
Have to reload to make it work
 
  login: Promise.method(function(email, password) {
    if (!email || !password) throw new Error('Email and password are both required');
    return new this({email: email.toLowerCase().trim()}).fetch({require: true}).tap(function(customer) {
      return bcrypt.compareAsync(customer.get('password'), password);
    });
  })
Looking at some examples
Am I missing something, or will this completely ignore the result of the password comparison?
bcrype.compareAsync doesn't reject, it always resolves with a boolean (unless hash is invalid, probably)
 
7:44 PM
(I'm looking at you here @BenjaminGruenbaum)
 
Is it just me or does ant-man seem kind of lame?
 
batman
ops
yes ant-man is lame
 
@SterlingArcher You mean the character in general or something from the upcoming movie?
 
I mean just the name..
 
kinda both tbh
 
7:49 PM
I thought Captain America and Thor would be pretty lame, and I enjoy both of those characters quite a bit.
 
wat
You doubted the Capt?
 
Yeah. No one else thought guy running around with an American flag on his head throwing a shield at Nazis might not turn out that great?
 
this whole 'out to get me' thing is getting old. the js room has no vendetta out on you. — rlemon 5 secs ago
 
He's a character built on optimism and modern films tend to be pretty cynical. Especially with ideas like patriotism.
@rlemon Oh lord, that's still going on?
 
@bjb568 HOW IS THIS OFFENSIVE OR SPAM?!
 
7:57 PM
if you flag it, they will come. And then they will dispute the flag. Because reasons.
 
guys I have another dumb question.
 
@rlemon What?
 
some people need their flag capabilities revoked.
 
That is.
 
lol keep em coming
 
7:58 PM
What on earth is going on?
 
@rlemon - I almost said valid on the flag from your comment. Try not to get flagged when making valid points in the future.
 
Screenshot comments please? They were deleted
 
I got banned like 2 hours ago because I said I would stab a bitch.
 
noob
 
7:59 PM
For 29 minutes :(
 
@TravisJ say anything in this room about bjb and you'll get flagged.
at least, since the last week
 
I have no idea who that is
 
He's a guy who flags you if you ping him with grievances or disagreements
 
days = [1,2,3,4];
dayMap = [
  { label: "Monday", value: 0 },
  { label: "Tuesday", value: 1 },
  // etc...
]
 
@NickDugger a user who used to frequent here, got into it with some regulars and stopped coming by.
 
8:01 PM
Well, good riddance?
 
How can I get all the things in daymap which have a value in days?
 
Well that worked , but I will appreciate an explanation — BipBip 55 secs ago
^ good guy OP
 
I've gotten irritated with a few people in here, some of whom were RO's, but in the end, we don't cry about it.
 
@NickDugger That's not the issue; he's running for moderator, some JS regulars commented that they didn't think he'd be the best for the position, and he's decided that the entire JS room is persecuting him now.
 
I've been irritated with many people. :P we're all adults (mostly) and we can move on from any small indiscretions
 
8:03 PM
I still wanna see deleted comments D:
 
If he sucks, he sucks. There must be evidence of him being a bad candidate other than a single chat room
 
yes we're adults
 
15 is not adult
 
mentally of course
>:)
 
8:04 PM
@Catgocat Says the person in the "Teenager Programmers" chatroom.
 
I should be a mod. I'll ban all of the jQuery users
2
 
Come on now
 
Voted :D
 
voted
might go back and DV a few
undecided
 
I have a snarky thing to say but Imma hold back bc flags
 
8:06 PM
The guy is on his 794th consecutive day
Omg
 
Vote for me; I will be a good mod. I pay $5 pls
 
Place your bets!
Calling it. Deceze, Martijn Pieters and Second Rikudo.
 
@Catgocat I'm on 500th something
in my entire time on SO i've missed like 40 days
 
Go get social (not cybersocial)
You got my vote :)
Or maybe not.. who knows
 
Psychosocial?
 
8:08 PM
I don't think Second Rikudo should be a mod, but call it a difference of opinion.
 
I wish consecutive meant weekdays lol I'd have a lot
 
@Catgocat at my age "social" is talking to the cashier at the grocery store while I check out.
 
My vote may influence you, and you might not be mod if you don't get my vote.
I have the power
Jk, but you would be a good mod @rlemon.. (i just don't have 150 reputation to vote :c)
 
haha
no, I really wouldn't
 
8:13 PM
Did you apply for it?
 
nope
 
y not?
 
!!listcommands
 
i dont see a valid reason, besides you dont want to
 
!!undo
dammit
 
8:14 PM
Needs patching though
 
@Catgocat Are you saying "I don't want to" isn't a valid reason?
 
Is there an operation like python's .join in javascript? Eg, ", ".join([x for x in list_of_strings])`
 
@KendallFrey spacex.com/webcast
 
No, I said it was valid.. I said besides
 
@corvid Yes. Array.prototype.join
 
8:17 PM
@NickDugger
 
@KendallFrey 14 minutes and counting!
DUDE
 
Generic Reddit "found OP's Mum's dildo" comment
 
Why isn't my back reference to the string in the brackets working? /(pa)\2/.test("papa")
 
@rlemon What's it carrying?
 
Use \1 instead of \2 @StevensHaen
 
8:22 PM
@BenFortune a payload.. probably
 
@Catgocat It still results in false
 
Wait, is it just orbiting then returning to land?
 
/(pa)\1/.test("papa")
 
T-10:30
where the hell is @KendallFrey?!?!?
 
@rlemon he's on the rocket
 
8:23 PM
Now you added to
there is no to in "papa"
Dude read the docs
 
@rlemon ohai
I was getting shit done
 
I should. I've seen people use 2 as a reference as well though. How come?
:22658906
 
user1596138
@StevensHaen That's just parenthesis around the whole thing.. It's not like it's in the regex
 
!!> /pa{2}/.test("papa")
 
8:25 PM
@rlemon false
 
aww
!!> /(pa){2}/.test("papa")
 
@rlemon true
 
run it by me again, what are we watching?
 
@KendallFrey space, man! space!
 
yeah, but where is it going
 
8:26 PM
space?
 
Space?
 
geez
!!afk taking a quick dump
 
thanks for sharing
 

 The Pod Bay

General discussion for space.stackexchange.com. Check our sche...
 
user1596138
@KendallFrey it's just a cargo run to ISS
 
8:28 PM
they're trying for the barge again as well
 
I hate being the bad guy and telling my coworker to redo his code...
 
user1596138
The cool part is the barge yeah
 
omg omg omg rockets
 
ooh, look at the little space thing there doing space stuff.
 
bullshit
 
8:30 PM
space stuff!
 
scrubbed
 
user1596138
dammit
 
it looks just like it's going to go all the way up into space
 
FNUEIFEP(FBEUPFBUIEPDB#U&#*$Y#@&
dammit
 
@rlemon oh, cool
!!youtube scott manley barge
 
from today
oh shit
I missed it
f'n scrubs
 
You kids and your rockets...
 
Timer stopped?
 
user1596138
@BenFortune scrubbed for weather
 
8:32 PM
is it a scrub or a hold
the timer is still there at 3:07
 
hold due to weather
 
user1596138
An alert went across that said scrubbed
 
so, scrubbed :( I have no hope
 
user1596138
> Today's launch has been scrubbed due to weather
 
fuck you attached anvil cloud
fuck
I closed the tab just before they said when it was gonna be tomorrow
 
user1596138
8:34 PM
@KendallFrey 4:10:40 EST
 
So I finished my list of work for this sprint today
sprint planning was this morning
 
@KendallFrey Sounds like your team's time estimation could use a bit of work?
 
nah
I just didn't have much work
I'll be doing mostly unassigned work
 
Ah. Yeah, I guess come to think of it, we pretty much never specifically assigned work in sprint planning.
 
I get assigned the 'big boy' tasks. Every. single. one.
 
8:41 PM
Yeah... that's usually how it broke down here too.
 
Please tell me you work for a proctologist
 
We didn't "assign" them... but it usually ended up that way anyway.
 
No one knows what is like to be the batman :(
 
@SterlingArcher Sometimes I'd rather.
 
._.
> "Man, working for the proctologist is such a pain in the ass"
 
8:45 PM
@Retsam Right now I'm basically the guy doing everything, while everyone else is busy with their own stuff
 
!!> /\bfoo\b/.test("foobar");
 
@StevensHaen "/\bfoo\b/.test(\"foobar\");"
 
@NickDugger Don't be a jerk. Adopt, don't buy..
 
@SecondRikudo I don't own an animal
at least not right now
 
8:52 PM
well, looks like the primaries are pretty much sorted out already
 
@ssube Nope.
 
those vote gaps are pretty significant
 
A big wave of votes from india is still ahead.
Those gaps are nothing.
The only one whom I'm sure will win is Martijn.
 
/\bfoo\b/.test("foobar"); returns null. How do I make the boundary marker work?
 
@SecondRikudo I expect meager, Jon Clements, Matt, and you to fill out the top 5
 
m59
8:54 PM
!!> foo: 'bar';
 
@m59 "bar"
 
m59
whaaaaaattt. Why is that not a syntax error?
 
especially since a number of candidates are still at -1
@m59 label for goto
 
@ssube Don't underestimate Raghav Sood.
 
@SecondRikudo 670 votes <3
 
8:55 PM
Only tomorrow we'll have a truly solid prediction.
Thank you to everyone voting for me
 
@SecondRikudo most of the candidates that mentioned being from india/asia also mentioned a very specific specialization tag, and most of the candidates that mentioned a particular tag were downvoted into oblivion
that last is curious, actually
 
SpaceX launch was scrubbed. Thank goodness. I wasn;t even aware of it until right now
and I'd like to go home
instead of staying late to watch it
 
specialization seems to be considered a negative when it comes to being a mod
specialization seems to be considered a negative when it comes to being a mod
 
-12
A: 2015 Moderator Election Q&A - Questionnaire

bjb568bjb568's answers Technically I'm still a candidate… Just disqualified because of rep. So… A question is asked and receives some very good answers. The asker then flags this question and asks for it to be deleted because having it up will cause them trouble at work or school. Do you delete th...

 
say it, don't spray it
 

« first day (1640 days earlier)      last day (3309 days later) »