03-树1. List Leaves (25) Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. Input Specification: Each input file contains one test case. For each case, the first line gives a positive integer N (<=10) wh…
一.JavaScript判断对象类型 1.可以使用typeof函数判断对象类型 function checkObject1(){ var str="str"; console.log(typeof(str))//输出"string"; console.log(typeof(str)=="string")//输出true; } 2.使用对象的构造函数属性(constructor),来判断对象的类型: function checkObject2()…
childNodes遍历DOM节点树 var s = ""; function travel(space,node) { if(node.tagName){ s += space + node.tagName + "</br>" } var len = node.childNodes.length for (var i=0; i<len; i++){ travel(space+"--",node.childNodes[i]) }…