I have this simple code below. I'm trying to query the name of any shape that is entered in the input box. I can pass the parameter in the function correctly, but when I try to query it using the parameter, it's causing me an error.
console.log(shape); //I'm getting the right input as parameter
console.log(shapes.shape.name); //not successful using passed parameter.
//code below
<div id="page">
   <input type="text" id="getShape"/>
   <input type="button" onClick="getShapeDetails()" />
</div>
<script>
   shapes = {
      "circle"   : {"name":"circle", "sides":"0", "color":"yellow"},        
      "triangle" : {"name":"triangle", "sides":"3", "color":"red"},         
      "square"   : {"name":"square", "sides":"4", "color":"blue"},  
   };
   function getShapeDetails(){
      var getShape = document.getElementById("getShape").value;
      function getShapesDetail(shape){
         console.log(shape);
     console.log(shapes.shape.name);
      }
      getShapesDetail(getShape);
   }
</script>
 
     
     
    