consider the following example
data = null
function read_data() {
//read a file and assign data = file content
}
function print() {
console.log(data)
}
if i call read_data and then print from another script, would it print null? or should I call read_data everytime I need to print it?
New contributor
Juliana Restrepo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1