使用es6的startsWith和endsWith方法
let str='postedit';
if(str.startsWith('po')){
alert('開頭正確');
}else if(str.endsWith('it')){
alert('結束正確');
}
使用es6的startsWith和endsWith方法
let str='postedit';
if(str.startsWith('po')){
alert('開頭正確');
}else if(str.endsWith('it')){
alert('結束正確');
}
1.jQuery 尺寸操作 jQuery 尺寸操作包括元素寬高的獲取和設置,且不一樣的API對應不一樣的盒子模型 <body> <div></div> <script> $(function() {
文章目錄 一.構造函數和原型 1.對象的創建方式 1.2靜態成員和實例成員 1.2.1實例成員 1.2.2靜態成員 1.3構造函數的問題 1.4構造函數原型prototype