Note: When mapping the _includes
identifier to ECMAscript, the leading U+005F LOW LINE (“_“) character should be removed. A leading “_“ is used to escape the identifier from looking like a reserved word (in this case, the includes
keyword).
range . [lower](#dom-idbkeyrange-lower)
Returns , or undefined
if none.
range . [upper](#dom-idbkeyrange-upper)
Returns upper bound, or undefined
if none.
range . [lowerOpen](#dom-idbkeyrange-loweropen)
Returns true if the is set, and false otherwise.
range . [upperOpen](#dom-idbkeyrange-upperopen)
Returns true if the upper open flag is set, and false otherwise.
The lower
attribute’s getter must return result of running the steps to with the lower bound if it is not null, or undefined otherwise.
The upper
attribute’s getter must return the result of running the steps to with the upper bound if it is not null, or undefined otherwise.
The lowerOpen
attribute’s getter must return true if the is set, and false otherwise.
The upperOpen
attribute’s getter must return true if the upper open flag is set, and false otherwise.
range = [IDBKeyRange](#idbkeyrange)
. [only](#dom-idbkeyrange-only)
(key)
Returns a new spanning only key.
Returns a new [IDBKeyRange](#idbkeyrange)
starting at key with no upper bound. If open is true, key is not included in the range.
range = [IDBKeyRange](#idbkeyrange)
. [upperBound](#dom-idbkeyrange-upperbound)
(key [, open = false])
Returns a new [IDBKeyRange](#idbkeyrange)
with no lower bound and ending at key. If open is true, key is not included in the range.
range = [IDBKeyRange](#idbkeyrange)
. [bound](#dom-idbkeyrange-bound)
(lower, upper [, lowerOpen = false [, upperOpen = false]])
Returns a new [IDBKeyRange](#idbkeyrange)
spanning from lower to upper. If lowerOpen is true, lower is not included in the range. If upperOpen is true, upper is not included in the range.
The only(value)
method, when invoked, must run these steps:
Let key be the result of running the steps to with value. Rethrow any exceptions.
If key is invalid, throw a “
[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)
“[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException)
.Create and return a new containing only key.
The lowerBound(lower, lowerOpen)
method, when invoked, must run these steps:
Let lowerKey be the result of running the steps to convert a value to a key with lower. Rethrow any exceptions.
If lowerKey is invalid, a “
[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)
“ .
The upperBound(upper, upperOpen)
method, when invoked, must run these steps:
Let upperKey be the result of running the steps to with upper. Rethrow any exceptions.
Create and return a new key range with set to null, lower open flag set, set if upperKey, and upper open flag set to upperOpen.
The bound(lower, upper, lowerOpen, upperOpen)
method, when invoked, must run these steps:
Let lowerKey be the result of running the steps to with lower. Rethrow any exceptions.
If lowerKey is invalid, throw a “
[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)
“[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException)
.If upperKey is invalid, a “
[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)
“[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException)
.If lowerKey is greater than upperKey, a “
[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)
“[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException)
.Create and return a new key range with set to lowerKey, lower open flag set if lowerOpen is true, set to upperKey and upper open flag set if upperOpen is true.
range . [includes](#dom-idbkeyrange-includes)
(key)
Returns true if key is included in the range, and false otherwise.
The includes(key)
method, when invoked, must run these steps:
Let k be the result of running the steps to with key. Rethrow any exceptions.
If k is invalid, throw a “
[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)
“[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException)
.
🚧 The method is new in this edition. It is supported in Chrome 52, Firefox 47, and Safari 10.1. 🚧