-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Closed
Closed
Copy link
Labels
questionIssues that look for answers.Issues that look for answers.wrong repoIssues that should be opened in another repository.Issues that should be opened in another repository.
Description
why the variable cannot be changed after calling the function?
this is my code:
const tabletojson = require('tabletojson');
var email ;
tabletojson.convertUrl(
'https://myurl
,
{ stripHtmlFromCells: true },
function(tablesAsJson) {
email = tablesAsJson[2][7][1];
var result2 = tablesAsJson;
console.log(result2);
var Firstname;
var lastname;
Firstname = tablesAsJson[0][1][1]
lastname = tablesAsJson[0][0][1]
console.log("Hello Sir: "+Firstname + " " +lastname + ". your email is : " + email)
console.log(email)// this prints the correct answer
}
);
> while trying to print email in out scope of the function
its returning a blank text with console.log("the email is " + email);
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.wrong repoIssues that should be opened in another repository.Issues that should be opened in another repository.