My question is about the _metaConnect function in chat.js. Here's the function:
function _metaConnect(message) {
if (!$scope.joined) {
$scope.connected = false;
_connectionClosed();
} else {
var wasConnected = $scope.connected;
$scope.connected = message.successful === true;
if (!wasConnected && $scope.connected) {
_connectionEstablished();
} else if (wasConnected && !$scope.connected) {
_connectionBroken();
}
}
}
Specifically, what does the line
$scope.connected = message.successful === true;
accomplish?
$scope.connected
gets the value ofmessage.successful === true
.message.successful === true
has the value true ifmessage.successful
has the valuetrue
or false ifmessage.successful
has any other value.