Sunday, 15 June 2014

javascript - Get value of an array based on priority -


I have an object array that is based on priority, I need to create an orange image. I have the code below which I try , "EXECUTION_TYPE": "R_PRE_EXECUTION", and " }; Var arr = {"arr (var temp)" for ["arr_resc", " If (data_res [i] .RULE_EXECUTION_TYPE.indexOf (arr [temp]) -1) {console.log ("data") console.log (JSON.stringify (data_res [temp])}}

The output that I'm getting

  data Undefined data {"ACTION_TYPE": "CREATE", "EXECUTION_TYPE": "N_EXECUTION"}  

I want data based on my array arr . > R_PRE_EXECUTION should be made like data S_PRE_EXECUTION and then N_PRE_EXECUTION , I do not know where I am wrong.

It looks like you arr_res to arr .

 Var code = ["R_PRE_EXECUTION": "EXECUTION_TYPE": "EXECUTION_TYPE": "EXECUTION_TYPE": "N_EXECUTION"}, {"ACTION_TYPE": "Create", "EXECUTION_TYPE": "R_PRE_EXECUTION"}] var arr = , "S_PRE_EXECUTION", "N_EXECUTION"]; Data_res.sort (function (a, b) {var aKey = arr.indexOf (a.EXECUTION_TYPE); var bKey = arr.indexOf (b.EXECUTION_TYPE); return aKey - bKey;}); Document.write ("& lt; Prev"; + JSON.stringify (Data_res, 0,3));  


No comments:

Post a Comment