<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
//数组常用的API
//1.slice(start,end)重点,就是切片的操作 注意:字符串和数组是可以有通用的API的!!slice()方法就是字符串和数组通用的!!
var str='hello world'
var res1=str.slice(0,5)
console.log(res1);
//2.split(分隔的字符):把字符串转为数组!!
var str1='hello china'
var res2=str1.split('e')
console.log(res2);
</script>
</body>
</html>