Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a JavaScript function bitChecker(number) that finds if the bit 3 an integer number
- (counting from 0) is 1. Write JS program checkingBits.js to check a few numbers.
- The result (true or false) should be printed on the console. */
- "use strict";
- function bitChecker(number) {
- return !!(number & 8);
- }
- console.log(bitChecker(1));
- console.log(bitChecker(333));
- console.log(bitChecker(425));
- console.log(bitChecker(2567564754));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement