KeyboardLayoutMap: thuộc tính size
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Thuộc tính chỉ đọc size của giao diện KeyboardLayoutMap trả về số phần tử trong bản đồ.
Thuộc tính này giống với Map.prototype.size.
Giá trị
Một số.
Ví dụ
Ví dụ sau lấy số lượng chuỗi theo vị trí hoặc bố cục cụ thể và mã bàn phím liên kết của nó trên bàn phím QWERTY tiếng Anh.
js
navigator.keyboard.getLayoutMap().then((keyboardLayoutMap) => {
console.log(keyboardLayoutMap.size);
});
Thông số kỹ thuật
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-get-map.prototype.size> |