MDN self-hosted library · e01.org

KeyboardLayoutMap: size property

Keyboard API

Open notebook · 1 cells web-api-instance-property upstream source

Keyboard API

The size read-only property of the KeyboardLayoutMap interface returns the number of elements in the map.

The property is otherwise the same as Map.prototype.size.

Value

A number.

Examples

The following example get the count of the location- or layout-specific string and its associated keyboard code on an English QWERTY keyboard.

navigator.keyboard.getLayoutMap().then((keyboardLayoutMap) => {
  console.log(keyboardLayoutMap.size);
});

Specifications

Browser compatibility

See also

  • Map.prototype.size