function switchChannel(channelName) {
    //Log the channel switch
    console.log("Tuning in to channel", channelName);

    // #7 #dgst use object properties to write channel name
    document.getElementById('channel-name').innerHTML = channelName.name;

    // #7 #dgst use object properties to write channel location
    document.getElementById('channel-location').innerHTML = 'by <a href="http://w3w.co/' + channelName.createdBy + '" target="_blank"><strong>' + channelName.createdBy + '</strong></a>';

    // #7 #trn toggle star based on object property
    $('#channel-star').removeClass('fa-star, fa-star-o');
    $('#channel-star').addClass(channelName.starred ? 'fa-star' : 'fa-star-o');
    
    /* highlight the selected #channel.
       This is inefficient (jQuery has to search all channel list items), but we'll change it later on */
    $('#channels li').removeClass('selected');
    $('#channels li:contains(' + channelName.name + ')').addClass('selected');
    
    //#7 set and log currentChannel
    currentChannel = channelName;
    console.log("currentChannel", currentChannel);
}
/**
/**
 * function for the #channels name in the right app bar
 * @param channelName Text which is set
 */
function for the #channels name in the right app bar
@param channelName Text which is set
function for the #channels name in the right app bar @param channelName Text which is set
function switchChannel(channelName) {
    console.log("Tuning in to channel", channelName);
    document.getElementById('channel-name').innerHTML = channelName.name;
    document.getElementById('channel-location').innerHTML = 'by <a href="http://w3w.co/' + channelName.createdBy + '" target="_blank"><strong>' + channelName.createdBy + '</strong></a>';
    $('#channel-star').removeClass('fa-star, fa-star-o');
    $('#channel-star').addClass(channelName.starred ? 'fa-star' : 'fa-star-o');
    $('#channels li').removeClass('selected');
    $('#channels li:contains(' + channelName.name + ')').addClass('selected');
    currentChannel = channelName;
    console.log("currentChannel", currentChannel);
}
function switchChannel ( channelName ) { console . log ( "Tuning in to channel" , channelName ) ; document . getElementById ( 'channel-name' ) . innerHTML = channelName . name ; document . getElementById ( 'channel-location' ) . innerHTML = 'by <a href="http://w3w.co/' + channelName . createdBy + '" target="_blank"><strong>' + channelName . createdBy + '</strong></a>' ; $ ( '#channel-star' ) . removeClass ( 'fa-star, fa-star-o' ) ; $ ( '#channel-star' ) . addClass ( channelName . starred ? 'fa-star' : 'fa-star-o' ) ; $ ( '#channels li' ) . removeClass ( 'selected' ) ; $ ( '#channels li:contains(' + channelName . name + ')' ) . addClass ( 'selected' ) ; currentChannel = channelName ; console . log ( "currentChannel" , currentChannel ) ; }
function for the #channels name in the right app bar
 @param channelName Text which is set
function for the #channels name in the right app bar @param channelName Text which is set
//Log the channel switch
 // #7 #dgst use object properties to write channel name
 // #7 #dgst use object properties to write channel location
 // #7 #trn toggle star based on object property
 /* highlight the selected #channel.
       This is inefficient (jQuery has to search all channel list items), but we'll change it later on */ //#7 set and log currentChannel
