2017-09-22 66 views

回答

0

如果你指的是CKEDITOR.tools.getIndex(),你可以使用JavaScript自己的Array.prototype.findIndex()(不適用於Internet Explorer雖然):

function isBigEnough(element) { 
    return element >= 15; 
} 

[12, 5, 8, 130, 44].findIndex(isBigEnough); 
// index of 4th element in the Array is returned, 
// so this will result in '3' 
相關問題