JsPropertyKey Struct
A property key: a string or a symbol (https://tc39.es/ecma262/#sec-object-type).
public readonly struct JsPropertyKey : IEquatable<JsPropertyKey>- Implements
Constructors
| Name | Description |
|---|---|
| JsPropertyKey(JsSymbol) | Creates a symbol key. |
| JsPropertyKey(string) | Creates a string key. |
Properties
| Name | Description |
|---|---|
| IsString | Gets whether the key is a string. |
| IsSymbol | Gets whether the key is a symbol. |
IsString
JsPropertyKey.csIsSymbol
JsPropertyKey.csMethods
| Name | Description |
|---|---|
| AsString() | Gets the string of a string key. |
| AsSymbol() | Gets the symbol of a symbol key. |
| Equals(JsPropertyKey) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromValue(JsValue) | Creates a key from a string or a symbol value, without running code. |
| GetHashCode() | Returns the hash code for this instance. |
| ToJsValue() | Gets the key as a JavaScript value (a string or a symbol). |
| ToString() | Returns the fully qualified type name of this instance. |
| TryGetArrayIndex(uint) | Gets whether the key is an array index (https://tc39.es/ecma262/#array-index): the canonical string of an integer below 2^32 - 1. |
AsString()
JsPropertyKey.csAsSymbol()
JsPropertyKey.csEquals overloads
Equals(JsPropertyKey)
JsPropertyKey.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(JsPropertyKey other)Parameters
otherJsPropertyKey- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
JsPropertyKey.csFromValue(JsValue)
JsPropertyKey.csCreates a key from a string or a symbol value, without running code.
public static JsPropertyKey FromValue(JsValue value)GetHashCode()
JsPropertyKey.csToJsValue()
JsPropertyKey.csToString()
JsPropertyKey.csTryGetArrayIndex(uint)
JsPropertyKey.csOperators
| Name | Description |
|---|---|
| operator ==(JsPropertyKey, JsPropertyKey) | Compares two keys. |
| implicit operator JsPropertyKey(JsSymbol) | Creates a symbol key. |
| implicit operator JsPropertyKey(string) | Creates a string key. |
| operator !=(JsPropertyKey, JsPropertyKey) | Compares two keys. |
operator ==(JsPropertyKey, JsPropertyKey)
JsPropertyKey.csCompares two keys.
public static bool operator ==(JsPropertyKey left, JsPropertyKey right)op_Implicit overloads
implicit operator JsPropertyKey(JsSymbol)
JsPropertyKey.csCreates a symbol key.
public static implicit operator JsPropertyKey(JsSymbol symbol)implicit operator JsPropertyKey(string)
JsPropertyKey.csCreates a string key.
public static implicit operator JsPropertyKey(string name)operator !=(JsPropertyKey, JsPropertyKey)
JsPropertyKey.csCompares two keys.
public static bool operator !=(JsPropertyKey left, JsPropertyKey right)