Check out example codes for "difference between innerhtml and textcontent". It will help you in understanding the concepts better.

Code Example 1

difference between innerhtml and textcontent

Code Example 2

java is virtualised and compiled while javascript isn't.
javascript and java aren't that similar apart from beign 
both OOP.

Code Example 3

//You can use useHistory() in any component, 
//but props.history only in components where the history is available in props

//When you use history.push, you do NOT have to specify the pathname. 

const queryString = new URLSearchParams(params).toString()
    history.push({
      search: "?" + queryString
    });

Learn ReactJs, React Native from akashmittal.com