vendredi 17 avril 2015

Turning each string in JSON object into a JavaScript array

I have a JSON object with length 220 as follows:



var tF = ["PETMEI 2011: the 1st international workshop on pervasive eye tracking and mobile eye-based interaction","Pseudo-Volumetric 3D Display Solutions", .....]


I want to create an array like this:



var arr = ["PETMEI","2011:", "the", "1st", "international", "workshop".........]


I have tried this method but it doesn't work as intended:



var arr = Object.keys(tF).map(function(k) { return tF[k] });


Any ideas on how to create an array as fast as possible?


Here is my working DEMO .


Thanks for your help!


Aucun commentaire:

Enregistrer un commentaire