JSFiddle - React, Tailwind, and code Playground

by stirl021

JavaScript

let model = [[3950,6230,2280,"Hello. I am Baymax,"],[6260,8400,2140,"your personal healthcare companion."],[8410,10770,2360,"Uh, hey, Baymax."],[10780,13590,2810,"I didn't know you were still active."],[13610,15710,2100,"I heard a sound of distress."],[15730,17470,1740,"What seems to be the trouble?"],[17520,20160,2640,"Oh, I just stubbed my toe a little."],[20180,20810,630,"I'm fine."],[20820,23320,2500,"On a scale of 1 to 10,"],[23340,25110,1770,"how would you rate your pain?"],[25130,28080,2950,"A zero. I'm okay, really."],[28100,30120,2020,"Thanks. You can shrink now."],[30140,31740,1600,"Does it hurt when I touch it?"],[31750,33670,1920,"That's okay. No touching."],[33680,39400,5720,"I'm fine... Ah!"],[41570,42790,1220,"You have fallen."],[43130,43860,730,"You think?"],[46970,48510,1540,"- On a scale of 1 to... - Ow!"],[48590,49700,1110,"- On a scale..."],[49710,50930,1220,"- On a sca... - Ow!"],[50950,53450,2500,"- On a scale of 1 to 10..."],[53460,56870,3410,"On a scale of 1 to 10, how would you rate your pain?"],[56880,58640,1760,"Zero."],[58660,61060,2400,"- It is all right to cry. - No. No, no, no, no."],[61060,63230,2170,"Crying is a natural response to pain."],[63230,64180,950,"I'm not crying."],[64180,66730,2550,"- I will scan you for injuries. - Don't scan me."],[66730,68610,1880,"- Scan complete. - Unbelievable."],[68610,70690,2080,"You have sustained no injuries."],[70690,73320,2630,"However, your hormone and neurotransmitter levels"],[73320,76000,2680,"indicate that you are experiencing mood swings"],[76000,77380,1380,"common in adolescence."],[77580,80150,2570,"Diagnosis, puberty."],[80160,81290,1130,"Whoa, what?"],[81310,83860,2550,"Okay. Time to shrink now."]];

let object = {
			start: '',
			end: '',
			duration: '',
			subtitle: ''
		};
    
let subtitles = model.map(m => {
			
			object.start = m[0];
			object.end = m[1];
			object.duration = m[2];
			object.subtitle = m[3];
			console.log(object);
      return object;
		});
   ...