I have variables which I put inside an array. When I loop through the array I assign values to the variables. When I console.log(variable) it returns undefined.  Example:  var test1, test2; var tests[test1, test2]; function change(){ for(var i=0;i&lt;tests.lenght;i++){    tests[i] = i; }} change(); console.log(test1); //returns undefined   Shouldn't the output be 0? What am I missing?  Edit  I think I understand now, but how to apply to specif problem:  var table1 = {}; var table2 = {}; var tables = [table1, table2];  function initiDataTables(urlsToInit){         for(var i = 0; i&lt;tables.length; i++){             var tempUrl = urlsToInit[i];             var name = '#example'+i.toString();             var name2 = name + ' tbody';             console.log(name);             tables[i].val = $(name).DataTable({                 'autoWidth'   : false,                 'ajax': {                     'url' : tempUrl,                     'dataSrc' : '',                 },                 'columns': [                     {'data':'ID'},                     {'data':'Naziv'},                     {'data':'File'},                     {'defaultContent':"&lt;button id='btnView1' class='btn btnview btn-primary'&gt;Prikaži&lt;/button&gt;"},                     {'defaultContent':"&lt;button id='btnDelete1' class='btn btndel btn-danger'&gt;Obriši&lt;/button&gt;"},                 ],                 'columnDefs' : [                     { 'visible': false, 'targets': [2] }                 ]             });              console.log('Check' + table1);               $(name2).on( 'click', '.btnview', function () {                 var data = tables[i].val.row( $(this).parents('tr') ).data();//here it gives me undefined                 window.open('Images/'+data.File, 'window name', 'window settings');             } );              $('.dataTableServer').on( 'click', '.btndel', function () {                 var data = tables[i].row( $(this).parents('tr') ).data();                 //deleteData('news', data.ID);             } );         }        }   I am trying to initialize multiple datatables.
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?
Scala 2.10 + Json serialization and deserialization Prevent Photos app on OSX from launching when plugging in device The Photos app opens whenever I plug in my phone.    How can this be prevented?  I have seen many solutions for the old iPhoto app that involve changing the "Connecting camera opens" option, but the new app has no such option. I've heard many times that it's bad to use display: none for SEO reasons, as it could be an attempt to push in irrelevant popular keywords. A few questions:   Is that still received wisdom? Does it make a difference if you're only hiding a single word, or perhaps a single character? If you should avoid any use of it, what are the preferred techniques for hiding (in situations where you need it to become visible again on certain conditions)?   Some references I've found so far:       If you're straight-out using CSS to hide text, don't be surprised if that is called spam. I'm not saying that mouseovers or DHTML text or have-a-logo-but-also-have-text is spam; I answered that last one at a conference when I said "imagine how it would look to a visitor, a competitor, or someone checking out a spam report. If you show your company's name and it's Expo Markers instead of an Expo Markers logo, you should be fine. If the text you decide to show is 'Expo Markers cheap online discount buy online Expo Markers sale ...' then I would be more cautious, because that can look bad."   And  on the same article     We can flag text that appears to be hidden using CSS at Google. To date we have not algorithmically removed sites for doing that. We try hard to avoid throwing babies out with bathwater.   Eric Enge      The legitimate use of this technique is so prevalent that I would rarely expect search engines to penalize a site for using the display: none attribute. It’s just very difficult to implement an algorithm that could truly ferret out whether the particular use of display: none is meant to deceive the search engines or not. How to find files that contain one criterion but exclude a different criterion Script to determine if files are Images I would like to create a shell script that will check to make sure all files in a directory are image files.  We recently had an issue where a hacker was able to generate a file in a directory and mask it as a .jpg file. I would like to create a shell script to check all files in the directory to make sure they are real jpg, gif or png files. How to delete an element from an array in C# Lets say I have this array,  int[] numbers = {1, 3, 4, 9, 2};   How can I delete an element by "name"? , lets say number 4?  Even ArrayList didn't help to delete?  string strNumbers = " 1, 3, 4, 9, 2"; ArrayList numbers = new ArrayList(strNumbers.Split(new char[] { ',' })); numbers.RemoveAt(numbers.IndexOf(4)); foreach (var n in numbers) {     Response.Write(n); } How do I make all the theorem-alike environments have an ending symbol? Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is?  I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail. Evaluating the sum after reordering an infinite series $1-\frac {1} {2}+\frac {1} {3}-\frac {1} {4}+\ldots $ If in the series  $1-\dfrac {1} {2}+\dfrac {1} {3}-\dfrac {1} {4}+\ldots $ the order of the terms be altered, so that the ratio of the number of positive terms to the number of negative terms in the first $n$ terms is ultimately $a^{2}$, show that the sum of the series will become $\log \left( 2a\right) $.  Solution attempt. Let $p$ be the number of positive terms in the first $n$ terms of the reordered series so based on the question we are allowed $a^{2}=\dfrac {p} {n-p}$. Now solving for p we get $p=\dfrac {a^{2}n} {\left( 1+a^{2}\right) }$ and $n-p=\dfrac {n } {\left( 1+a^{2}\right) }$.  We also observe that in the original series only the odd terms are positive and only the even terms are negative.  Let's define $S_{odd}=1+\dfrac {1} {3}+\dfrac {1} {5}+.\ldots +\dfrac {1} {2n-1}$ and $S_{even}=\dfrac {-1} {2}\dfrac {-1} {4}\ldots -\dfrac {1} {2n}$  $S_{Reordered}=S_{odd_{p}}+S_{even_{n-p}}$  $S_{Reordered}=\sum _{t=1}^{t=P}\dfrac {1} {2t-1}+\sum _{t=1}^{t=(n-P)}\dfrac {-1} {2t}$ $S_{Reordered}=\sum _{t=1}^{t=\dfrac {a^{2}n} {\left( 1+a^{2}\right) }}\dfrac {1} {2t-1}+\sum _{t=1}^{t=\dfrac {n } {\left( 1+a^{2}\right) }}\dfrac {-1} {2t}$    In order to extend $S_{Reordered}$ from n terms to an infinite length. I guess i should take the limit of the $S_{Reordered}$ as $n\rightarrow \infty $ which would make the upper values of $t$ (Not sure of technical term here) to be $\infty$ giving me   $S_{Reordered}=\sum _{t=1}^{t=\infty}\dfrac {1} {2t-1}+\sum _{t=1}^{t=\infty}\dfrac {-1} {2t}$   and i have lost the $a$ from the expression. I guess i am stuck i need to perform some step to capture a before taking the limit. Any help would be much appreciated. How can I play encrypted DVD movies? What is the command that lets me see what and where devices are mounted?  I'm having trouble changing songs on my old iPod, and I have a feeling it's because of the mount point. When are infinities okay? I'm a little confused about how to handle infinities in physics. On the one hand, I always here things like infinities are not physically tenable answers. GR can't answer anything about the origin of the universe because of singularities. Throw away the radial solution that gives an infinite potential when solving the Laplace equation in spherical coordinates. But then there are other times that the infinities are okay. For instance, it is usually okay to set the reference point for your potential at infinity. There are certain times in David Tong's quantum field theory lecture notes where he seems to almost to hand wave away infinities. So, philosophically, physically, and mathematically when are infinities okay, and when are they not okay? If G is not commutative, then is there always a subgroup that is not a normal subgroup? What is the difference between apt and apt-get? I'd like to be able to find out which process is currently using a certain port in Linux. Is there any way to do this? We all know that _spPageContextInfo is a very useful thing in Client side development. I need something equivalent of _spPageContextInfo in SPFX. Currently I am unable to use it directly from typescript. It gives error like     Can not find '_spPageContextInfo'   Finally, I have gone through the API documentation of  and  found . PageContext has dependence with . My qestion is: How to use PageContext? I need to use it my BaseService class. constructor of my class is:  constructor(private $http: ng.IHttpService, private $q: ng.IQService, serviceScope: ServiceScope) {     serviceScope.whenFinished(() =&gt; {       this.pageContext = new PageContext(serviceScope);       console.log(this.pageContext);     });   }   Inside the constructor serviceScope is undefined. I know the reason: As I am not injecting/initialising serviceScope anywhere like other angular services. So what is the approach of injecting/initialising serviceScope in angular service class? I can buy Dell Latitude E7270 through my employer. It will come with Windows, but I would like to install Ubuntu (most likely 14.04). This model does not appear on the list of certified hardware, however. Does anyone know whether I should anticipate any problems with his laptop? Thanks! Trying to put a footnote in subsection title:  \subsection{Effect of Lateral Confinement on SW Band Structure\footnote{Parts of this sub--section are based on \citet{Venkat2013}}}   produces the following error:  Argument of \@sect has an extra } ...section are based on \citet{Venkat2013}}}   I am using:   \documentclass[paper=A4, fontsize=12, toc=listof, toc=index, toc=bib]{scrreprt}   Please advise. Creating unnumbered chapters/sections (plus adding them to the ToC and/or header) Setting "checked" for a checkbox with jQuery I'd like to do something like this to tick a checkbox using jQuery:  $(".myCheckBox").checked(true);   or  $(".myCheckBox").selected(true);   Does such a thing exist?