本文實(shí)例講述了es6數(shù)組includes()用法。分享給大家供大家參考,具體如下: Array.prototype.includes方法返回一個(gè)布爾值,表示某個(gè)數(shù)組是否包含給定的值,與字符串的includes方法類(lèi)似。ES2016引入了該方法。 1 2 3 [1, 2, 3].includes(2)// true [1, 2, 3].includes(4)// true ...
www.dbjr.com.cn/article/1849...htm 2025-6-5