JavaScript typu testowego JavaScript

if(typeof bar === 'string') {
   //whatever
}
CollectiveMind