将“13579”转为[1,3,5,7,9]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
var str="135879";
var arr=[];
for(var a=0;a<str.length;a++){
console.log(str.charAt(a));
var char=parseInt(str.charAt(a));
arr.push(char);
}
console.log(arr);
</script>
</body>
</html>