what is use of tilde in js code example
Example: 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
//Bitwise operator
console.log(~-2); // 1
console.log(~-1); // 0
//Converting Strings to Numbers
console.log(~~"-1"); // -1
console.log(~~"0"); // 0