Two return statements in javascript



function test() {
    try {
        return 'mongo';
    } catch (e) {
        console.log('error', e)
        return 'redis'
    } finally {
        console.log('finally it returns value as elastic not mongo');
        return 'elastic';
    }

}

Comments

Popular posts from this blog

Proxy setting in java

Using logstash to import csv json files into elasticsearch

Kibana 4 Installation and Run as a service in ubuntu