Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
402 views
in Technique[技术] by (71.8m points)

javascript - JavaScript中与var_dump或print_r等效的JavaScript是什么? [重复](What is the JavaScript equivalent of var_dump or print_r in PHP? [duplicate])

This question already has an answer here:(这个问题已经在这里有了答案:)

I would like to see the structure of object in JavaScript (for debugging).(我想查看JavaScript中的对象结构(用于调试)。)

Is there anything similar to var_dump in PHP?(有什么类似于PHP中的var_dump吗?)   ask by Adriana translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Most modern browsers have a console in their developer tools, useful for this sort of debugging.(大多数现代的浏览器在其开发人员工具中都有一个控制台,对于此类调试很有用。)

console.log(myvar);

Then you will get a nicely mapped out interface of the object/whatever in the console.(然后,您将在控制台中获得对象/任何对象的映射良好的接口。)

Check out the console documentation for more details.(查看console文档以获取更多详细信息。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...