examples/amazon-lex-with-lambda.js
function buildAvailableTimeString(availabilities) {
    let prefix = 'We have availabilities at ';
    if (availabilities.length > 3) {
        prefix = 'We have plenty of availability, including ';
    }
    prefix += buildTimeOutputString(availabilities[0]);
    if (availabilities.length === 2) {
        return `${prefix} and ${buildTimeOutputString(availabilities[1])}`;
    }
    return `${prefix}, ${buildTimeOutputString(availabilities[1])} and ${buildTimeOutputString(availabilities[2])}`;
}
function buildAvailableTimeString(availabilities) {
    let prefix = 'We have availabilities at ';
    if (availabilities.length > 3) {
        prefix = 'We have plenty of availability, including ';
    }
    prefix += buildTimeOutputString(availabilities[0]);
    if (availabilities.length === 2) {
        return `${prefix} and ${buildTimeOutputString(availabilities[1])}`;
    }
    return `${prefix}, ${buildTimeOutputString(availabilities[1])} and ${buildTimeOutputString(availabilities[2])}`;
}
function buildAvailableTimeString ( availabilities ) { let prefix = 'We have availabilities at ' ; if ( availabilities . length > 3 ) { prefix = 'We have plenty of availability, including ' ; } prefix += buildTimeOutputString ( availabilities [ 0 ] ) ; if ( availabilities . length === 2 ) { return ` ${ prefix } ${ buildTimeOutputString ( availabilities [ 1 ] ) } ` ; } return ` ${ prefix } ${ buildTimeOutputString ( availabilities [ 1 ] ) } ${ buildTimeOutputString ( availabilities [ 2 ] ) } ` ; }
Build a string eliciting for a possible time slot among at least two availabilities.
Build a string eliciting for a possible time slot among at least two availabilities .