loadSmartConfig function I am writing a conditional that checks two values, for several different scenarios.

What I am modifying is a series of objects, some of these objects are in arrays, and some are just arrays. I need to check these values and then check a file, and then check my values (the series of objects, array objects, and arrays) and then "Update" the old data with my new data if needed. However the user has the ability to turn some sections off if they don't want their data to be overwritten in the case of changes. So in order to do this I check if a certain property exists (the ones used to turn them on or off) and then check if its on or if its off. which has led to a conditional of this size: (And this is NOT everything, I stopped here to see if there was a shorter less counter-productive way of doing this

if ((this.Config[key] === this.Config.PunishTiers || this.Config[key] === this.Config.Titles || this.Config[key] === this.Config.Ranks || this.Config[key] === this.Config.Messages &amp;&amp; this.Config.Message.Messages) || (this.Config[key] === this.Config.Prefix &amp;&amp; this.Config.Prefix.Prefixes))
             || (this.Config[key] === this.Config.Settings &amp;&amp; this.Config.Settings.Settings)) {
                oldData.push(this.Config[key]);
        }


The first three checks do not have the setting, so they are fine but everything after has the check if it exists, and check for the setting to be on or off. Is there any way to reduce this? Make it neater and possibly less of a struggle when used.

This has to stick with mainly pure JavaScript if possible.

This is being used through a plugin for the oxide framework. To check a plugin's configuration file grab the data, check for local configs and apply changes where specified. or "Updates" 

Here is the whole function setup:

loadSmartConfig: function(changed) {
            print("Smart Updating Data Now.")
            var oldData = [],
                newData = [];
            for (var key in this.Config) {
                if (this.Config[key] === this.Config.PunishTiers || this.Config[key] === this.Config.Titles || this.Config[key] === this.Config.Ranks) {
                    oldData.push(this.Config[key]);
                if ((this.Config[key] === this.Config.Messages &amp;&amp; this.Config.Message.Messages) 
                    || (this.Config[key] === this.Config.Prefix &amp;&amp; this.Config.Prefix.Prefixes)
                    || (this.Config[key] === this.Config.Settings &amp;&amp; this.Config.Settings.Settings)) {
                    oldData.push(this.Config[key]);
                }
                } else {
                    continue;


}
            }
            if (oldData.length &gt; 0) {
                this.LoadDefaultConfig();
            }

        if (this.Config.PunishTiers !== undefined &amp;&amp; this.Config.Titles !== undefined &amp;&amp; this.Config.Ranks !== undefined) {
            for (var i = 0; i &lt; oldData.length; i++) {
                if (oldData[i].length === 1) {
                    this.Config.PunishTiers = oldData[i];
                } else if (oldData[i].hasOwnProperty("authLvl")) {
                    this.Config.Titles = oldData[i];
                } else if (oldData[i].hasOwnProperty("rank")) {
                    this.Config.Ranks = oldData[i];
                } else if (oldData[i].hasOwnProperty("Messages") &amp;&amp; oldData[i].Messages) {
                    this.Config.Messages = oldData[i];
                } else if (oldData[i].hasOwnProperty("Prefixes") &amp;&amp; oldData[i].Prefixes) {
                    this.Config.Prefix = oldData[i];
                } else if (oldData[i].hasOwnProperty("Settings") &amp;&amp; oldData[i].Settings){
                    this.Config.Settings = oldData[i];
                }
            }
            this.SaveConfig();
        },


this is also why I was pushing for pure JavaScript if possible.
It's hard to analyze without the whole context, but a possible workaround could be to add the whole keys in a collection, and apply a filter like _.some of underscore.js.

var aColection = [this.Config.Ranks, this.Config.Message,..]
_.some(aCollection, function (element) {
  return this.Config[key] === element
})


If you don't want add this library to your core code, you can simply copy  the definition of some.

GitHub