In Live demo code of Bluetooth sample, it should be:
.then(function(value) {
// In Chrome 50+, a DataView is returned instead of an ArrayBuffer.
value = value.buffer ? value : new DataView(value);
$target.innerHTML = 'Battery percentage is <b>' + value.getUint8(0) + '</b>.';
})
In Live demo code of Bluetooth sample, it should be:
or simply:
instead of: