Back to Content

KeyboardLayoutMap: size property

files/en-us/web/api/keyboardlayoutmap/size/index.md

latest667 B
Original Source

{{SeeCompatTable}}{{APIRef("Keyboard API")}}

The size read-only property of the {{domxref("KeyboardLayoutMap")}} interface returns the number of elements in the map.

The property is otherwise the same as {{jsxref("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.

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{jsxref("Map.prototype.size")}}