开发者

In Js How to wrap all last childred of an oject tree?

开发者 https://www.devze.com 2022-12-23 09:27 出处:网络
Just wanted to write some recursion but can\'t check if the child is in fac开发者_JS百科t some finite thing, when checking throught jQuery.isPlainObject , just getting a saparate letters as a childs ,

Just wanted to write some recursion but can't check if the child is in fac开发者_JS百科t some finite thing, when checking throught jQuery.isPlainObject , just getting a saparate letters as a childs , like I want "this is error message" - to be a last child , but can't detect it


Shot in the dark here:

typeof "hello" === "string"

typeof {} === "object"

With this, you can tell if the child is a string ("this is error message") or another type of object.

0

精彩评论

暂无评论...
验证码 换一张
取 消