This question already has answers here:
What does this symbol mean in JavaScript?
(1 answer)
What's the significant use of unary plus and minus operators?
(2 answers)
Closed 2 years ago.
I have problem with understanding this code. I know what it do, but I dont understand the "+" after return.
function descendingOrder(n) {
return +n.toString().split('').sort().reverse().join('');
}
Related
This question already has answers here:
What is the JavaScript >>> operator and how do you use it?
(7 answers)
What do these JavaScript bitwise operators do?
(3 answers)
Closed 12 days ago.
Can anyone Explain me if i doing -
(10>>>2) = 2
(10>>2) = 2
both same then what difference
This question already has answers here:
Question mark before dot in javascript / react [duplicate]
(1 answer)
Optional Chaining in JavaScript [duplicate]
(8 answers)
What does this symbol mean in JavaScript?
(1 answer)
Closed 2 years ago.
I have no idea what ?. means. Example:
React.useEffect(() => {
if (route.params?.post) {
// Post updated, do something with `route.params.post`
// For example, send the post to the server
}
}, [route.params?.post]);
It's hard to google the answer. I just see articles on the conditional (ternary) operator.
This question already has answers here:
What do ">>" and "<<" mean in Javascript?
(10 answers)
What does the ^ (caret) symbol do in JavaScript?
(5 answers)
What do these JavaScript bitwise operators do?
(3 answers)
What does this symbol mean in JavaScript?
(1 answer)
Closed 8 months ago.
I was going through a small program and i came across this syntax in javascript.
hash = Math.abs((hash << 2) ^ (hash + y))
please what does it mean?
hash was initially 0; i.e hash = 0;
This question already has answers here:
Why can't I access a property of an integer with a single dot?
(5 answers)
Why does 10..toString() work, but 10.toString() does not? [duplicate]
(3 answers)
Why don't number literals have access to Number methods? [duplicate]
(3 answers)
Closed 3 years ago.
The following syntax generates an error:
5.toString();
But the following doesn't:
(5).toString();
What does the parentheses exactly do here?
This question already has answers here:
What are the different ways of writing an IIFE? What are their use cases?
(2 answers)
What does the exclamation mark do before the function?
(8 answers)
Closed 4 years ago.
I have seen the bitwise operator used in a self calling function, see below example, so I have a simple question, what does it do?
~(function() {
alert("Hello World");
})();