This seems like a simple problem...
I possess an object
const VR03 = {
name: "Eternal Growth Ring",
price: "2500"
}
Within a function, I am assigning a string to a variable
function myFunction(){
let js_type = jQuery('#type').val();
console.log(js_type); //returns "VR03"
}
Is there a way to retrieve VR03.name
using only the js_type
variable?
function myFunction(){
jQuery('h1').text(?);
}
I attempted String(js_type).name
but it yields the same result as js_type.name