2
Answers

How to get the first Data in JavaScript

Dhana Balan

Dhana Balan

4y
536
1
Hi ,
 
I have Mulltiple Data's in Javascript Like ("10002938760183,98037801738394,28364920474800,28364920474801,28364920474802") this type of data.
 
I need to  get the first element of 10002938760183 this data.
 
How to get this data in Javascript .
 
Example:
 
var str = "How, are, you, doing, today";
var res = str.split(","); 
 
Output is : How, are, you, doing, today 
 
I need a output on "How" only.
 
Thanks,
Dhanabalan R 
Answers (2)