scripts/database.js
/**
 * Determine whether or not to update the JourneyID stored in currentJourney
 * @param {String} currentJourney The JourneyID of the current Journey, derived from the previous dbRecord row analysed
 * @param {String} nextJourney The JourneyID of the nextJourney, derived from the current dbRecord row being analysed
 * @return {String} The value of currentJourney - now equal to nextJourney if we're on to the next journey, or the initial value
 *                  of current journey that was sent to this function if the journey we're on hasn't changed
 */
Determine whether or not to update the JourneyID stored in currentJourney
@param {String} currentJourney The JourneyID of the current Journey, derived from the previous dbRecord row analysed
@param {String} nextJourney The JourneyID of the nextJourney, derived from the current dbRecord row being analysed
@return {String} The value of currentJourney - now equal to nextJourney if we're on to the next journey, or the initial value
of current journey that was sent to this function if the journey we're on hasn't changed
Determine whether or not to update the JourneyID stored in currentJourney @param { String } currentJourney The JourneyID of the current Journey derived from the previous dbRecord row analysed @param { String } nextJourney The JourneyID of the nextJourney derived from the current dbRecord row being analysed @return { String } The value of currentJourney - now equal to nextJourney if we ' re on to the next journey or the initial value of current journey that was sent to this function if the journey we ' re on hasn ' t changed
function checkUpdateCurrentJourney(currentJourney, nextJourney) {
	if(currentJourney != nextJourney)
		currentJourney = nextJourney
	return currentJourney
}
function checkUpdateCurrentJourney ( currentJourney , nextJourney ) { if ( currentJourney != nextJourney ) currentJourney = nextJourney return currentJourney }
Determine whether or not to update the JourneyID stored in currentJourney
 @param {String} currentJourney The JourneyID of the current Journey, derived from the previous dbRecord row analysed
 @param {String} nextJourney The JourneyID of the nextJourney, derived from the current dbRecord row being analysed
 @return {String} The value of currentJourney - now equal to nextJourney if we're on to the next journey, or the initial value
                  of current journey that was sent to this function if the journey we're on hasn't changed
Determine whether or not to update the JourneyID stored in currentJourney @param { String } currentJourney The JourneyID of the current Journey derived from the previous dbRecord row analysed @param { String } nextJourney The JourneyID of the nextJourney derived from the current dbRecord row being analysed @return { String } The value of currentJourney - now equal to nextJourney if we ' re on to the next journey or the initial value of current journey that was sent to this function if the journey we ' re on hasn ' t changed
//If the JourneyID's don't match, update currentJourney to be that of the new current journey