i need explanation about object or date in javascript. Because i made some variable with value an object(date), but after i change the a new variable, all variables and the object is being change. I don't know why this happen.  Here is the code  var expDate = new Date(Date.now()); var minExpDate = expDate; var maxExpDate = expDate;  minExpDate.setDate(minExpDate.getDate() + 30); maxExpDate.setDate(maxExpDate.getDate() + parseInt(chf.Get('ExtraDays')));  alert(expDate + '\n' + minExpDate + '\n' + maxExpDate);   but it's okay if i make a new object  var expDate = new Date(Date.now()); var minExpDate = new Date(expDate); var maxExpDate = new Date(expDate);  minExpDate.setDate(minExpDate.getDate() + 30); maxExpDate.setDate(maxExpDate.getDate() + parseInt(chf.Get('ExtraDays')));  alert(expDate + '\n' + minExpDate + '\n' + maxExpDate);   Sorry for my english and the title is too weird. And i hope to get some explanation why this happen.  Thank you,
The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?
Reason for the current trend to use «she» as the gender-neutral pronoun? Clever bounty reputation hack I say "hack" in the most favorable light. It's a clever idea and theoretically beneficial.  I noticed that an old question of mine suddenly started getting a lot of renewed attention. The question had been answered, with an answer accepted. But another user added a well reasoned and insightful answer to the list. He also opened a +100 bounty on that question.  The resulting increased attention quickly got his answer quite a lot of up-votes. Well more than the 100 points he had spent on the bounty. Therefore, he gets a net rep profit out of the transaction.  So here's the hack:   Find an interesting question Research and provide a very good answer Open up a bounty on that question to attract attention and votes to your new answer Profit!!!   2 and 3 may be out of order--I didn't see the timing of it. But either way, assuming he gets more than 10 votes, he still gets increased rep out of the deal.  I don't think this is necessarily bad for SO - it does generate some useful discussion and insightful answers. Plus you can increase your own rep very rapidly by making your answers highly visible, and therefore frequently voted upon.   However, it does slightly change the meaning and purpose of bounties away from starting a discussion and toward self-promotion. Still, interesting. Reset select value to default I just wanted to ask whether there is any command which would work on common shells (bash, dash, kornshell)? It is supposed to check if the line variable contains any part of the path.  if [[ $line =~ "$PWD"$ ]] ;then I want to append this text:  &lt;Directory "/var/www/*"&gt;     Order allow,deny     Allow from all     AllowOverride All &lt;/Directory&gt;   to the file /etc/apache2/apache2.conf  I have access via SSH but I don't know how to use VIM. I would like to do this via a command. Can a person negotiate with banks on CD interest rates? I use a brick and mortar bank for some of my savings. I’d love to get a CD interest rate closer to what Ally or other online banks offer.   Are brick and mortar banks will to negotiate with customers on interest rates? For instance, if I went into a branch and said I’m moving my money to Ally unless the bank matches Ally’s rates, do I have any chance of getting them to? Create a workflow rule when Lead status is changed from X to Y I want to create a workflow rule which should be triggered when I change the Lead Status value from 'Open: Not Contacted' to 'Open: Working'  Any help with this please? Is this sentence acceptable?     You’re welcome, have a nice day ahead. Why is using "for...in" for array iteration a bad idea? I've been told not to use for...in with arrays in JavaScript. Why not? I understand that assuming light is quantized implies that if a lower energy interacts with  metal, it is possible that that quanta will not have enough energy to eject the electron. What prevents two quanta from interacting with the electron at the same time, though, and summing to have enough energy to release the particle. Indeed, what if two separate light rays of the same frequency impact the electron, why can't that free it? When is the move constructor called in the `std::move()` function? What is the correct way to install proprietary ATI Catalyst Video Drivers (fglrx) directly from AMD? Hint:  $a^2 -ab +b^2 = (a+b)^2 -3ab.$  I know we can say that there exists an $x,y$ such that $ax + by = 1$.  So in this case, $(a+b)x + ((a+b)^2 -3ab)y =1.$  I thought setting $x = (a+b)$ and $y = -1$ would help but that gives me $3ab =1.$  Any suggestions? How to list files that were changed in a certain range of time? "She need not worry" or "she needs to not worry"? I just came across this weird use of &quot;need not&quot; on :  Madam/sir, My daughter is stuck in Uk . She has lost her  . She is difficult to return back India home [sic]. Please help  In response,  says:  She need not worry. She should stay where she is. Just tell her to keep herself safe. Please delete your tweet.  Shouldn't it be &quot;she doesn't need to worry&quot; or &quot;she needs to not worry&quot; given that the subject is &quot;she&quot; (singular)? Or is this some kind of grammatical construction I don't know? I believe who wrote it was a native speaker of English and they might be correct. Can someone explain this please? What are some practices for getting a name change so that people can find me more easily? For a similar thing, , where Jay Wacker managed to get people to call him by the name Jay even though he didn't need to get a legal name change. I'm not sure how to go about this though.  The main problem with me is that I have such a frustratingly common name that a lot of people cannot find me when they google me. So many of them simply don't notice the middle initial that I always use in between my first and last names, and this could actually become a major issue in academia, since people have little time and are prone to giving up quickly if they want to look for me (or for my papers) and can't find me at all (I know this having seen how several academics use the Internet and how they look for people's names). This, in turn, could easily ruin my citation count in the future (it's not just that - it's helpful to others when I have a less common name so that they can more easily locate my stuff). I already know at least several people who specifically told me that they tried to find my email but that they couldn't find it (and this isn't limited to just them - there are many, many more - including long-lost friends who have wanted to talk to me for a long time, but who couldn't find me due to said ultra-common name). Of course, people can go through the respective university directories, but how many people really do that? From my observations (when I've seen people look for someone else), very very few do it. Hell, there are even several people at my OWN university who share the same exact first+last name as me.  In Academia, this is even a bigger problem because the vast majority of your connections will be people who only vaguely recognize/know you, so they may know most of the search clues. Even a "full name" + university won't solve all the problems, because I may switch universities and people may only remember the old university that I was in. I'm also very very interdisciplinary, so I want to be searchable to people outside my field as well.  And even if I fix the issue for Google with a massive SEO operation or whatever (that may even be impossible for my ridiculously common name), it's still not going to fix the problem for all of the other ways that people use search.  I'm currently transitioning between undergrad and grad school, so now may be the perfect time for a name change? But I don't know what to do. Is it better for me to change my first name or my last name? The problem is that a citation like "Chen 2011" is going to produce so many entries that no one will ever find them, even though they frequently do google things like that (and I simply cannot prevent people from googling something like that). Chen is so frustratingly common that even a "Chen and Name2 2011" paper could come from some random medical paper rather than from something I wrote.  As an additional complication, the % of Chinese people using the English Internet is exponentially rising, and I can only expect the problem to get worse in the future because of that (and not just for my first name, but even variants of my first name too). I am really satisfied that $(x \to a) ≠(x=a)$ and if that is not right , Then all the process of $Limits$ is dividing by zero and that is a crime.  Since $(x \to a) + h = (x=a)$ , $h ≠ 0$,So Why does $f(x \to a) = f(x = a)$ ?  NOTE:I am talking about continuous function. I've heard a lot about the Undying Lands but I don't fully understand how they're different from Middle-earth and why only certain people/races are allowed to go there.  Can someone explain? I know several questions were asked about the difference between "going to" and "will". Based on several answers (see, for instance, ,  and ), I understood that "will" is more spontaneous and "going to" is used with more planned actions.  So, it seems that everything is pretty fine. However, in , Kosmonaut has an answer in which he states: "Let's say that tomorrow you will walk your dog from 7 - 8 AM".  On the one hand, you probably planned to walk your dog long before and thus I should use "Let's say that tomorrow you're going to walk your dog from 7 - 8 am".   On the other hand, since I'm saying "let's say...", I'm deciding right now (thus, unplanned) that you will walk your dog. So, even though in this hypothetical situation you made a plan, I'm in a more spontaneous mood deciding right now that that's what you will do tomorrow, and, thus, I should use "will".  Which one (if any) of the above explanations is right? Start modal operator from a click in panel I want to start a modal operator by clicking a button in a panel in the properties region. It should then stop when I click somewhere in the 3D viewport. I want to execute some code when I start and finish the operator (see the code below). I tried modifiyng the modal operator template with an execute method to start the modal operator. But the now the context.space_data.type is always &quot;PROPERTIES&quot; because that's where the panel is located, I guess. Is this a bad way of doing what I want? class MY_OPERATOR_OT_click_on_3dview(bpy.types.Operator):          bl_idname = &quot;mesh.click_on_3dview&quot;     bl_label = &quot;Click on 3D&quot;      def modal(self, context, event):                  if context.space_data.type != 'VIEW_3D':             return {'PASS_THROUGH'}                  if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:             # allow navigation             return {'PASS_THROUGH'}         elif event.type == 'LEFTMOUSE':             # DO ALL THE POST-SELECT STUFF             return {'FINISHED'}         elif event.type in {'RIGHTMOUSE', 'ESC'}:             return {'CANCELLED'}          return {'RUNNING_MODAL'}      def execute(self, context):         # DO ALL THE SETUP STUFF           context.window_manager.modal_handler_add(self)              return {'RUNNING_MODAL'}            def cancel(self, context):         print(&quot;CANCEL???&quot;)