<!DOCTYPE html><html><head>? ? <title>Prototype Pattern Example</title>? ? <script type="text/javascript">? ? ? ? ? ? ? ? ? ??? ? ? ? ? ? ? ? ? ??? ? ? ? alert(typeof Array.prototype.sort); ? ? ? ? //"function"? ? ? ? alert(typeof String.prototype.substring); ? //"function"? ? ? ? String.prototype.startsWith = function (text) {? ? ? ? ? ? return this.indexOf(text) == 0;? ? ? ? };? ? ? ??? ? ? ? var msg = "Hello world!";? ? ? ? alert(msg.startsWith("Hello")); ? //true? ? ? ??? ? </script></head><body></body></html>
問(wèn)下這段代碼中的==0 是什么意思。
甫里
2016-04-06 19:54:25