function onReadyStateChange() {
            if (configRequest.readyState === 4) {
                if (typeof callback === "function") {
                    if (configRequest.status === 200) {
                        callback(null, JSON.parse(configRequest.responseText));
                    } else {
                        callback(configRequest.statusText);
                    }
                } else {
                    if (configRequest.status === 200) {
                        var config = JSON.parse(configRequest.responseText);
                        self.configuration = config;
                        if (config.deviceLevelOverrideEnabled === true) {
                            self.deviceConfig = config.deviceLevelAppConfig;
                        } else if (self.abtestingOverrideEnabled === true) {
                            self.deviceConfig = config.abtestingAppConfig;
                        } else {
                            self.deviceConfig = config.defaultAppConfig;
                        }
                    }
                }
            }
        }
//Or we can return the parsed out config.
Or we can return the parsed out config.
Or we can return the parsed out config .
function onReadyStateChange() {
            if (configRequest.readyState === 4) {
                if (typeof callback === "function") {
                    if (configRequest.status === 200) {
                        callback(null, JSON.parse(configRequest.responseText));
                    } else {
                        callback(configRequest.statusText);
                    }
                } else {
                    if (configRequest.status === 200) {
                        var config = JSON.parse(configRequest.responseText);
                        self.configuration = config;
                        if (config.deviceLevelOverrideEnabled === true) {
                            self.deviceConfig = config.deviceLevelAppConfig;
                        } else if (self.abtestingOverrideEnabled === true) {
                            self.deviceConfig = config.abtestingAppConfig;
                        } else {
                            self.deviceConfig = config.defaultAppConfig;
                        }
                    }
                }
            }
        }
function onReadyStateChange ( ) { if ( configRequest . readyState === 4 ) { if ( typeof callback === "function" ) { if ( configRequest . status === 200 ) { callback ( null , JSON . parse ( configRequest . responseText ) ) ; } else { callback ( configRequest . statusText ) ; } } else { if ( configRequest . status === 200 ) { var config = JSON . parse ( configRequest . responseText ) ; self . configuration = config ; if ( config . deviceLevelOverrideEnabled === true ) { self . deviceConfig = config . deviceLevelAppConfig ; } else if ( self . abtestingOverrideEnabled === true ) { self . deviceConfig = config . abtestingAppConfig ; } else { self . deviceConfig = config . defaultAppConfig ; } } } } }
Or we can return the parsed out config.
Or we can return the parsed out config .