javascript esplodere
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
javascript, stringa divisa
// Split string into an array of strings
const path = "/usr/home/chucknorris"
let result = path.split("/")
console.log(result)
// result
// ["", "usr", "home", "chucknorris"]
let username = result[3]
console.log(username)
// username
// "chucknorris"
split array javascript
// Returns new array from exising one
arr.slice(start, end);
in javascript come dividere la stringa
var str = 'It iS a 5r&e@@t Day.'
var array = str.split(" ");
print(array);
var str = 'It iS a 5r&e@@t Day.'
var array = str.split(" ",2);
print(array);
js split della stringa
var myString = "Hello World!";
// splitWords is an array
// [Hello,World!]
var splitWords = myString.split(" ");
// e.g. you can use it as an index or remove a specific word:
var hello = splitWords[splitWords.indexOf("Hello")];
COME DIVIDERE UN ARRAY JAVASCRIPT
array.splice(index, number, item1, ....., itemN)