jquery object items in array not defined -


i have array filled objects so:

var taskarray = [{     id: 247,     value: "pin lot" }, {     id: 249,     value: "excavate" }, {     id: 245,     value: "water & sewer installed" }, {     id: 246,     value: "pin footings" }, {     id: 248,     value: "footings" }, {     id: 251,     value: "footing inspection & pour" }, {     id: 250,     value: "foundation walls" }]; 

and when go console logs so:

console.log(taskarray); console.log(taskarray[0].taskid, taskarray[0].task); 

it says array empty. doing wrong ?

the objects in array not have properties taskid , task. instead

console.log(taskarray[0].id, taskarray[0].value); 

either use above or create array objects having properties taskid , task.

var taskarray = [{      id: 247,      value: "pin lot"  }, {      id: 249,      value: "excavate"  }, {      id: 245,      value: "water & sewer installed"  }, {      id: 246,      value: "pin footings"  }, {      id: 248,      value: "footings"  }, {      id: 251,      value: "footing inspection & pour"  }, {      id: 250,      value: "foundation walls"  }, {      id: 252,      value: "basement backfill"  }, {      id: 253,      value: "steel beams"  }, {      id: 254,      value: "framing , exterior"  }, {      id: 254,      value: "framing"  }, {      id: 300,      value: "brick received"  }, {      id: 255,      value: "roof ply"  }, {      id: 258,      value: "windows install"  }, {      id: 259,      value: "heating r/i"  }, {      id: 261,      value: "plumbing r/i"  }, {      id: 256,      value: "shingle roof (upper)"  }, {      id: 276,      value: "pour basement floors"  }, {      id: 257,      value: "stairs install"  }, {      id: 310,      value: "back-framing"  }, {      id: 260,      value: "electrical r/i"  }, {      id: 265,      value: "kitchen measure"  }, {      id: 262,      value: "alarm/vac/cable/phone r/i"  }, {      id: 311,      value: "frame check"  }, {      id: 322,      value: "frame pass"  }, {      id: 289,      value: "exterior brick work"  }, {      id: 290,      value: "exterior siding"  }, {      id: 317,      value: "shingle roof (lower)"  }, {      id: 209,      value: "drywall"  }, {      id: 307,      value: "furnace & ductwork"  }, {      id: 266,      value: "insulation"  }, {      id: 277,      value: "insulation inspection"  }, {      id: 263,      value: "hydro meter"  }, {      id: 309,      value: "gas meter"  }, {      id: 267,      value: "drywall walls/ceilings"  }, {      id: 268,      value: "taping"  }, {      id: 270,      value: "prime"  }, {      id: 273,      value: "install railings , nosing"  }, {      id: 274,      value: "install ceramics"  }, {      id: 278,      value: "install trim"  }, {      id: 308,      value: "drywall check"  }, {      id: 324,      value: "1st finish tech inspection"  }, {      id: 323,      value: "paint interior"  }, {      id: 280,      value: "paint exterior"  }, {      id: 279,      value: "install kitchen"  }, {      id: 326,      value: "back-trim"  }, {      id: 281,      value: "complete electrical"  }, {      id: 282,      value: "complete heating"  }, {      id: 284,      value: "complete cable/phone"  }, {      id: 283,      value: "complete plumbing"  }, {      id: 327,      value: "occupancy inspection"  }, {      id: 288,      value: "install carpet"  }, {      id: 325,      value: "2nd finish tech inspection"  }, {      id: 328,      value: "paint touch-up"  }, {      id: 330,      value: "qa inspection"  }, {      id: 329,      value: "1st clean"  }, {      id: 298,      value: "pdi"  }, {      id: 316,      value: "pdi deficiencies"  }, {      id: 331,      value: "2nd clean"  }];    console.log(taskarray[0].id, taskarray[0].value);


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -