Есть функция, как передать значения переменной s
в другую функцию?
function getId() {
const instance = axios.create({
headers: {
'Content-Type': 'application/json;charset=utf-8',
'Authorization': 'Bearer ' + token,
'fields': 'id,login,name,email'
}
});
instance.get(proxyurl + url)
.then(response => {
for (let i = 0; i < response.data.length; i++) {
let s = response.data[i].id
console.log(response.data[i].id)
}
})
}
function sum() {
const ins = axios.create({
headers: {
'Content-Type': 'application/json;charset=utf-8',
'Authorization': 'Bearer ' + token,
'fields': 'id,login,name,email'
}
})
let urlIssue = 'https://sad.myjetbrains.com/youtrack/api/issues/' + s + '?fields=summary,description';
ins.get(proxyurl + urlIssue)
.then(response => {
let a = response.data[i].summary
console.log(a)
})
}
s
?