Questions tagged as 'operadores'

2
answers

What is the function of the ~ (tilde) operator in JavaScript?

I tried to search for Google and SOEN, but I did not find any reference to the ~ operator, I discovered that it exists, since I was reading a book about JavaScript and had an example using it, but the author also had not made any referenc...
asked by 02.01.2014 / 22:03
4
answers

What is the difference between "&&" and "||" and "and" and "or" in PHP? Which one to use?

I have this question, what is the difference between && and || and between and and or ? Which one should I use?     
asked by 22.01.2015 / 16:04
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
2
answers

Differences between If and ternary operator?:

Is there a performance difference between using an if and a ternary operator in C #? I use Resharper (Productivity Tool for VS) , he insists that ternary operator is better but you do not explain why. Code, before Refactoring: if (i...
asked by 28.05.2014 / 16:01
1
answer

What is the meaning of the "??"

I was looking at some codes and I came across the ?? operator: static int? GetNullableInt() { return null; } int y = x ?? -1; What's the difference between the first code and the second one?     
asked by 16.12.2014 / 17:17
3
answers

Operator + = Java

I've always found that the += operator only worked as a shorter form for the traditional increment, for example: i += j; Instead of: i = i + j; But when performing the following experiment: int i = 3; long j = 7; So when I...
asked by 11.01.2014 / 19:28
3
answers

Difference between the use of typeof and is

In C # when I need to check if a variable is of a certain type, I usually use the is : if(qualquerVariavel is int) Console.Write("A variável é int"); I know you can also check the type of a variable in other ways, one of them is u...
asked by 11.09.2015 / 21:14
2
answers

What is the difference and what are the & & & & e | and || in Java?

I was analyzing some possibilities for the implementation of an algorithm and I went to search for this type of & and | , and I read some topics in English but it was not 100% clear to me what it is and where I can use it, it. T...
asked by 04.05.2015 / 20:48
2
answers

What is the "?." operator?

I'm seeing the functions that C # 6.0 brought, and an example of code appeared: C # 5.0 var vendor = new Company(); var location = default(string); if (vendor != null) if (vendor.ContactPerson != null) if (vendor.ContactPerson.HomeAdd...
asked by 11.10.2015 / 03:26
1
answer

What is the ~ (useful) operator in PHP?

What is the ~ (useful) operator in PHP? I have seen things like: echo ~PHP_INT_MAX Until then I thought it was to "reverse" a negative number or something, but with the tests I saw that I was wrong. Example: echo ~2; //Imprim...
asked by 03.08.2015 / 17:12