Strip on dynamic page conditional to item attribute

Also just tried this and still didn’t work
I’ve got no idea what’s wrong

function checkproptype ( ) {

**let**  prop  =  $w ( '#dynamicDataset' ). getCurrentItem () 
**let**  proptype  =  prop . typeOfAccommodation 

**if**  ( proptype  ===  "Hostel" ) { 
    $w ( '#hostelstrip' ). expand (); 
    $w ( '#columnStrip12' ). collapse (); 
}  **else**  { 
    $w ( '#hostelstrip' ). collapse (); 
    $w ( '#columnStrip12' ). expand (); 
} 

}