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

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -