setting a flag vs adding to stack

Edit on GitHub

Setting a flag vs pushing to an array

Setup

var flag;
var array;

Tests

  • setting a flag

    function setFlag(val) {
    flag = val;
    }
  • adding to stack

    var stack = [];
    stack.push({ companyId: 555, companyName: 'Nike', companyAddressLine1: 'Nike Towers', companyAddressLine2: 'Nike Road', companyAddressState: 'Ohio', companyAddressZip: '10001-01', companyCountry: 'United States', companyHqPhone: '001-756-555-0987', companyWebsite: 'http://www.nike.com', companyDuns: 847362982, companyRegistrationNumber: 683798309, companyRegisteredTax: '527498-098' });