First stage is hoisting variables. Second stage is execution.
Self-executing functions are executed on the second stage, just as any other piece of code. Your second salary is overwriting the upper declaration. In fact, you can ignore the first completely. After the first phase, the variable is hoisted and the code looks like this:
var salary;
console.log("Original salary was " + salary);
salary = "5000$";
console.log("My New Salary " + salary);
Boris Yankov
Front-End Engineer