1.

How to detect a mobile device with JavaScript?

Answer»

Use the JOIN() method to join the elements of an ARRAY into string with a separator. An example here: 

<!DOCTYPE html> <html> <body> <SCRIPT> var ARR = ["abc", "def", "ghi", "jkl"]; document.write("INITIAL array = "+arr); document.write("<br>Updated array = "+arr.join(" demo ")); </script> </body> </html>

Above, we have joined the elements into a string with a separator. 

The output is: 

Initial array = abc,def,ghi,jkl Updated array = abc demo def demo ghi demo jkl


Discussion

No Comment Found