.txt to array js code example Example: javascript text to array var str = "How are you doing today?"; var res = str.split(" ");