XRInputSourceArray: values() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheXRInputSourceArraymethodvalues() returns aJavaScriptiteratorthat can walk over the list ofXRInputSource objects contained in thearray, from first to last.
In this article
Syntax
values()Parameters
None.
Return value
AJavaScriptiterator thatcan be used to walk through the list ofXRInputSource objects in thearray, starting with the first entry (at index 0) and proceeding straight through thelist.
Examples
This example snippet walks through each input and calls thefunctioncheckInput() with each returned value.
for (const source of xrSession.inputSources.values()) { checkInput(source);}Here,for...ofis used to iterate over the array's contents. Each pass through the loop,source is the nextXRInputSource in the list. The loop exitsonce every input has been delivered tocheckInput().
Specifications
This feature does not appear to be defined in any specification.>Browser compatibility
See also
- Inputs and input sources
- The
XRInputSourceArraymethodkeys() - The
Arraymethodvalues() XRInputSource