I'm trying to get password from a json file with below code.
Now the password is shown in console. How can I assign it to a var?
fetch('assets/pwd.json')
.then(response => {
return response.json()
})
.then(data => {
console.log((data.password[0]))
})