美文网首页
形参的默认值

形参的默认值

作者: sahala318 | 来源:发表于2018-04-20 20:19 被阅读0次

<code>

let b = undefined;

        document.write(sum(b,b));

        function sum(first,second){

            first  = first || 0;

            second = second || 0;

            return first + second;

        }

</code>

+ nodeType

- 1-元素element

- 2-属性attr

- 3-文本text

- 8-注释comment

- 9-文档document

+ nodeName

- 元素结点:标签名称

- 属性结点:属性名称

- 文本结点:#text

- 文档结点:#document

+ nodeValue

- 元素结点: null

- 属性结点:属性值

- 文本结点:文本

- 文档结点:null

相关文章

网友评论

      本文标题:形参的默认值

      本文链接:https://www.haomeiwen.com/subject/cziatttx.html