Answer the question
In order to leave comments, you need to log in
I don't understand specifically what `+e.target.innerText` does?
I don't understand specifically what `+e.target.innerText` does
onYearBtnClick(e) {
this.props.setYear(+e.target.innerText)
}
Answer the question
In order to leave comments, you need to log in
They wrote in the comment that this is a unary plus, so that the text inside the node from the string is converted to a number.
https://learn.javascript.ru/operators
e.target - the element that was clicked
innerText - the text content of the element
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question