There's something I've been trying to figure out and I'm curious to get an answer on why it behaves this way.
const print_html = (param) => {
let container = document.querySelector('Container');
console.log(test_function(param)); // Why does this log the string?
container.textConent = test_function(param) // ... But the function is null here?
}
const test_function = (name) => {
return `My name is ${name}`;
};
print_html('Jermaine')
While the console log line prints the correct string to the console as expected, it's puzzling why the following line fails to set the textContent of the container to the string.