Questions tagged as 'javascript'

7
answers

How does this if / else work with "?" and ":"?

I am studying JavaScript and I have doubts about the different ways of doing if / else . For example, this: foo ? foo : foo How exactly does it work?     
asked by 08.02.2014 / 18:15
10
answers

How to create a site without reloading every click on a link?

I want to develop a site that runs around the same file, but I'm not sure how to look for study material for that. So: Normal site-> I'm on the Index.php page. When I click on the "Portfolio" menu, for example, it goes and loads the file P...
asked by 20.02.2014 / 05:48
5
answers

How Do Closures Work in JavaScript?

I've always wanted to know how Closures work in JavaScript, I've read some definitions but never quite understood. Could you give me a simple, objective but content explanation?     
asked by 11.01.2014 / 02:43
10
answers

What is the difference between the == and === operators in JavaScript?

I have the following code in JavaScript : var x = 0; if (x === false) { // não acessa } if (x == false) { // acessa } Why does the expression with the == operator return true and with the === operator retur...
asked by 11.12.2013 / 16:58
3
answers

How to get similar behavior between the Garbage Collection of a Single-Page Application and a Multiple-Page Application?

I've been doing a lot of research on the web and stackoverflow communities, and I'm getting to the point of believing that SPAs take almost no advantage from the GC algorithm of today's browsers. Our development team has been concerned with d...
asked by 28.04.2017 / 17:41
1
answer

What does the && operator mean between strings?

I found in a minted bootstrap file, the following: e=e&&e.replace(/.*(?=#[^\s]*$)/,"") The && operator appears to be applied between two strings. What does this mean?     
asked by 14.02.2014 / 16:46
7
answers

How to pass parameters in function calls by reference in JavaScript?

Recently I asked the question Why should we use anonymous functions with jQuery instead of the function directly? and along with the accepted answer came a second question: How to pass arguments to a JS function that we are invoking by refer...
asked by 03.02.2014 / 18:03
2
answers

Differences between localStorage Vs sessionStorage?

What are the differences, pros and cons between localStorage and sessionStorage ?     
asked by 06.06.2014 / 02:22
5
answers

How do anonymous functions work?

I know they are functions that do not have the specified name, but what is the purpose? Is recursion possible with anonymous functions? Ex: Fibonacci sequence. (function(x, y) { alert(x + y); })(5, 5); // Função para somar duas v...
asked by 20.03.2014 / 16:23
3
answers

What is the difference between $ (this) and $ this and this?

I've always used $(this) regardless of the situation and always worked. Rarely have I had to use one of the others and in those times I did for someone's guidance and not for knowing exactly what I had to do. So what's the difference...
asked by 22.10.2014 / 17:57