this is working the way I want, however I am a bit confused why it works.
I have two objects. set temp object equal to object A and manipulate temp object. Object A is affected.
set temp object equal to Object B (why aren't all three objects equal now?) I manipulate temp object. Object A is not affected.
var tempObject = {};
var objectA = {A: 1};
var objectB = {A: 3};
$( document ).ready(function() {
tempObject = objectA;
add(tempObject);
console.log(objectA);
tempObject = objectB;
add(tempObject);
console.log(objectA);
function add(arr){
arr.A += 1;
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>