This javascript function works well for reading values from an object when it is hardcoded.
function showNote(){
document.write(notes.B[1]);
}
But I can't get it to work with a variable. I would like to do something like this, but I get an undefined variable message.
<script>
showNote(B)
</script>
function showNote(y){
console.log(y);
document.write(notes.y[1]);
}