Skip to content
Subhajit Sahu edited this page Feb 2, 2021 · 14 revisions

Gets a bit. 🏃 📼 📦 🌔 📒

Alternatives: get, getAs.
Similar: get, set, toggle.

bit.get(x, i);
// x: an int32
// i: bit index
const bit = require("extra-bit");

bit.get(6, 0);
// 0 (110,0 => 0)

bit.get(6, 1);
// 1 (110,1 => 1)

bit.get(6, 2);
// 1 (110,2 => 1)

references

Clone this wiki locally