testing shortcircuit on objects

by Gerald Gillespie

HTML

<script src="https://support.kace.com/jkuery/www/js/jqplot/dist/jquery.jqplot.min.js"></script>
<script src="https://support.kace.com/jkuery/www/js/jqplot/dist/plugins/jqplot.barRenderer.min.js"></script>
<h3>JSON String</h3>
<div></div>
<br /><br />
<h3>JSON Object</h3>
<div></div>

JavaScript

var obj1 = { mary : { had : 'lamb'}};

var obj2 =  {otheranimals : ['cow','pig','chicken']};

var obj3 = { very : {many : 'many'}};


console.log('obj1: ',obj1.mary);

obj1['mary'] = obj2.otheranimals && obj3;


var wtf2 = obj2.otheranimals && obj3;
console.log('wtf2: ', wtf2);



for(var key in obj1){
  $('div:first').append(key);
}


  console.log('obj1: ',obj1.mary);