0
I came across a problem in javascript that in python would be simple to solve, just saying that the parameter refers to 'text'.
- create_element (text =
A média dos valores cadastrados é ${media_lista}.
)
But in Javascript, it reads the text in the parameter as 'elem', because it is the first parameter requested and SIMPLY IGNORES 'text='.
I know one of the solutions is to put 'text' as the first parameter to be passed, but it is not the solution I seek.
function create_element(elem='p', text, parent='result_box') {
let item = document.createElement(elem);
item.text = text;
parent.appendChild(item);
};