Answers for "what is use of tilde in js"

1

what is use of tilde in js

//Bitwise operator
console.log(~-2); // 1
console.log(~-1); // 0

//Converting Strings to Numbers
console.log(~~"-1");  // -1
console.log(~~"0");   // 0
Posted by: Guest on May-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language