Skip to content

Instantly share code, notes, and snippets.

@JacksonRMC
Created May 25, 2017 16:48
Show Gist options
  • Save JacksonRMC/1256514382ab6ba6c7a6a7e0794a62ba to your computer and use it in GitHub Desktop.
Save JacksonRMC/1256514382ab6ba6c7a6a7e0794a62ba to your computer and use it in GitHub Desktop.
var productExceptSelf = function(nums) {
let output = [];
for ( let i = 0 ; i < nums.length ; i++ ){
output.push(nums.reduce((x, y) => x + y) - nums[i]);
}
return output;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment