Javascript assign property from function -
i don't know if possible, i'd accomplish assign property value object function called. when function active
ran, i'd assign either true or false value object being created. can use self-executing functions in way?
here's code, still in-progress, there of sort accomplish able in javascript?
graphobj.list.push({ name: graphdata[i].name, value: math.floor(graphdata[i].time / graphdata[graphdata.length - 1] * 100), str: graphdata[i].strtime active: (function(){ if (activeactivityname != "" && graphdata[i].name == activeactivityname){ return true; } else { return false; } }) });
i want discourage using iife here since believe inappropriate use of iife. how assigning result of condition:
graphobj.list.push({ name: graphdata[i].name, value: math.floor(graphdata[i].time / graphdata[graphdata.length - 1] * 100), str: graphdata[i].strtime, active: (activeactivityname != "" && graphdata[i].name == activeactivityname) });
Comments
Post a Comment