what do the parentheses of object attributes mean in es6?
in the change event of the input box of the react form
handleChange = (e) => {
console.log(e);
this.setState({
value: e.target.value
});
}
the event object here is a proxy object. Print it to the console and output it as follows
[[Handler]] : Object
set : (target, prop, value)
__proto__ : Object
[[Target]] : SyntheticEvent
bubbles : (...)
cancelable : (...)
currentTarget : (...)
defaultPrevented : (...)
dispatchConfig : null
eventPhase : (...)
isDefaultPrevented : null
isPropagationStopped : null
isTrusted : (...)
nativeEvent : (...)
target : (...)
timeStamp : (...)
type : (...)
_dispatchInstances : null
_dispatchListeners : null
_targetInst : null
preventDefault : (...)
stopPropagation : (...)
get bubbles : ()
set bubbles : (val)
get cancelable : ()
set cancelable : (val)
get currentTarget : ()
set currentTarget : (val)
get defaultPrevented : ()
set defaultPrevented : (val)
get eventPhase : ()
set eventPhase : (val)
get isTrusted : ()
set isTrusted : (val)
get nativeEvent : ()
set nativeEvent : (val)
get target : ()
set target : (val)
get timeStamp : ()
set timeStamp : (val)
get type : ()
set type : (val)
get preventDefault : ()
set preventDefault : (val)
get stopPropagation : ()
set stopPropagation : (val)
__proto__ : Object
[[IsRevoked]] : false
if it is a function object, it will have such a structure
arguments : (...)
caller : (...)
length : 0
name : ""
prototype : {constructor: }
__proto__ : ()
[[FunctionLocation]] : emptyFunction.js:13
[[Scopes]] : Scopes[2]
what"s the point of naming the [[]] (both parentheses) attribute in this object?