Finding an employee from a given mother company This method finds an employee from a given mother company which consists of group of companies. An employee can work for many child company.

$scope.getEmployee = function(subsidiary, salaryScale){ //1
  var workingDepartments = [];//2
  var findInGroupOfCompanies =  function(comGroup, salaryScale){//3
                                 var salaryIndex = subsidiary[salaryScale];//4
                                 if(salaryIndex != "SUPERIOR" &amp;&amp; salaryIndex == comGroup.salaryIndex) {//5
                                     if(comGroup.hasSubsidiaries()) { //6
                                        findInGroupOfCompanies(comGroup, salaryScale++ ); //7
                                     } else {//8
                                        workingDepartments.push(comGroup);//8
                                       //and do some stuff
                                     }
                                 }
};


The method findInGroupOfCompanies and its function is separated by equal and intended. Is this formatting not adhering to general code styles in JS? Have I added spaces unnecessarily after line number 3?
Ultimately, style considerations are subject to opinion and your actual style usually doesn't matter as much as being consistent. That said, your code might be found more readable if formatted like so:

$scope.getEmployee = function(subsidiary, salaryScale) { //1
    var workingDepartments = []; //2
    var findInGroupOfCompanies = function(comGroup, salaryScale) { //3
        var salaryIndex = subsidiary[salaryScale]; //4
        if (salaryIndex != "SUPERIOR" &amp;&amp; salaryIndex == comGroup.salaryIndex) { //5
            if (comGroup.hasSubsidiaries()) { //6
                findInGroupOfCompanies(comGroup, salaryScale++); //7
            } else { //8
                workingDepartments.push(comGroup); //8
                //and do some stuff
            }
        }
    };


It's not necessary to indent findInGroupOfCompanies all the way to align with the equals sign. One additional level of indentation is sufficient to indicate a new block, and anybody reading the code can see that it's a new function declaration.