Necesito una task que devuelva unq variable fuera de la task
async function getUser(user) {
const res = await fetch(`https://api.github.com/users/${user}`);
const json = await res.json();
console.log(json.name);
}
All generations.
async function getUser(user) {
const res = await fetch(`https://api.github.com/users/${user}`);
const json = await res.json();
console.log(json.name);
}
var a;
function task1() {
function internal1() {
a = 1
}
internal1();
}
task1();
console.log(a)
function sum(a, b) {
return a + b
}
sum(1, 2)
function myfun(){
let variable = 0;
variable++;
return variable;
}
myfun(); // 1
myfun(); // 2
myfun(); // 3
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description
− sponsored −