<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><!--Online Python Tutorhttps://github.com/pgbovine/OnlinePythonTutor/Copyright (C) Philip J. Guo (philip@pgbovine.net)Permission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.--><head><title>JavaScript Tutor - Visualize JavaScript code execution to learnJavaScript online</title><meta http-equiv="Content-type" content="text/html; charset=UTF-8"/><!-- requirements for pytutor.js --><script type="text/javascript" src="js/d3.v2.min.js"></script><script type="text/javascript" src="js/jquery-1.8.2.min.js"></script><script type="text/javascript" src="js/jquery.ba-bbq.min.js"></script> <!-- for handling back button and URL hashes --><script type="text/javascript" src="js/jquery.ba-dotimeout.min.js"></script> <!-- for event debouncing --><script type="text/javascript" src="js/jquery.jsPlumb-1.3.10-all-min.js "></script> <!-- for rendering SVG connectorsDO NOT UPGRADE ABOVE 1.3.10 OR ELSE BREAKAGE WILL OCCUR --><script type="text/javascript" src="js/diff_match_patch.js"></script><script type="text/javascript" src="js/jquery-ui-1.11.4/jquery-ui.min.js"></script> <!-- for sliders and other UI elements --><link type="text/css" href="js/jquery-ui-1.11.4/jquery-ui.css" rel="stylesheet" /><!-- for annotation bubbles --><script type="text/javascript" src="js/jquery.qtip.min.js"></script><link type="text/css" href="css/jquery.qtip.css" rel="stylesheet" /><script type="text/javascript" src="js/pytutor.js"></script><link rel="stylesheet" href="css/pytutor.css"/><script type="text/javascript" src="js/holistic.js"></script><link rel="stylesheet" href="css/holistic.css"/><!-- requirements for opt-frontend.js --><!-- Ace online code editor --><script type="text/javascript" src="js/ace/src-min-noconflict/ace.js" charset="utf-8"></script><script type="text/javascript" src="js/opt-frontend-common.js"></script><script type="text/javascript" src="js/opt-frontend.js"></script><link rel="stylesheet" href="css/opt-frontend.css"/><!-- include this AFTER opt-frontend.js so that configurationglobal variables are already defined at load time --><script type="text/javascript" src="js/togetherjs/togetherjs-min.js"></script><script type="text/javascript" src="js/socket.io-client/socket.io.js"></script><script type="text/javascript" src="js/opt-testcases.js"></script><link rel="stylesheet" href="css/opt-testcases.css"/><!-- insert google-analytics.txt contents here --></head><body><table id="experimentalHeader"><tr><td valign="top"><div id="ssDiv"><button id="sharedSessionBtn" type="button" class="togetherjsBtn">Start shared session</button><div style="font-size: 7pt; margin-left: 2px; margin-top: 3px;"><a href="https://www.youtube.com/watch?v=Z2TIjNArOK4" target="_blank">What are shared sessions?</a></div></div><div><button id="getTutorBtn" type="button" class="togetherjsBtn" style="display: none;">Get help from a tutor</button></div><div id="sharedSessionDisplayDiv" style="display: none;"><button id="stopTogetherJSBtn" type="button" class="togetherjsBtn">End shared session</button><div style="width: 200px; font-size: 8pt; color: #666; margin-top: 5px;">Your chat logs and code may be recorded, anonymized, and analyzed for research.</div></div></td><td valign="top"><div id="togetherjsStatus"></div><div id="surveyHeader"></div><div id="adHeader" style="margin-left: 15px; margin-bottom: 35px;"><div id="optHeader" style="font-family: Georgia, Palatino, Times, serif; font-size: 13pt; margin-bottom: 10px;">JavaScript Tutor - Visualize JavaScript code execution to learn JavaScript online<p style="font-size: 10pt";>(also visualize<a href="visualize.html#py=2">Python</a>,<a href="java.html">Java</a>,<a href="javascript.html">JavaScript</a>,<a href="typescript.html">TypeScript</a>,<a href="ruby.html">Ruby</a>,<a href="c.html">C</a>,and<a href="cpp.html">C++</a>code)</p></div><!--<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle"style="display:inline-block;width:728px;height:90px"data-ad-client="ca-pub-7519401450079227"data-ad-slot="9796201192"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>--></div></td></tr></table><div id="pyInputPane"><div id="codeInputWarnings">Write JavaScript code here:<select id="pythonVersionSelector" style="display: none;"><option value="js">JavaScript</option></select></div><div id="someoneIsTypingDiv" style="color: #e93f34; font-weight: bold; display: none;">Someone is typing ...</div><div id="codeInputPane"></div> <!-- populate with a CodeMirror or Ace code editor instance --><div id="frontendErrorOutput"></div><div id="surveyPane"></div><p><button id="executeBtn" class="bigBtn" type="button">Visualize Execution</button></p><div id="javaOptionsPane" style="margin-top: 20px;">[<i>coming soon!</i>] Java options: pass in command-line arguments and feed user input to stdin</div><div id="optionsPane" style="margin-top: 18px; line-height: 150%; display: none;"><select id="cumulativeModeSelector" style="display: none;"><option value="false">hide exited frames [default]</option></select><select id="heapPrimitivesSelector" style="display: none;"><option value="false">inline primitives & nested objects [default]</option></select><select id="textualMemoryLabelsSelector" style="display: none;"><option value="false">draw pointers as arrows [default]</option></select><!-- hide these for now --><select id="drawParentPointerSelector" style="display: none;"><option value="false">hide environment parent pointers (default)</option><!--<option value="true">show environment parent pointers</option>--></select><select id="showOnlyOutputsSelector" style="display: none;"><option value="false">show everything (default)</option><!--<option value="true">show only outputs</option>--></select></div><p style="margin-top: 25px;"><a href="#" id="createTestsLink">Create test cases</a></p><div id="testCasesPane"></div><p style="margin-top: 25px; font-weight: bold;">JavaScript Examples</p><p style="margin-top: 5px;"><a class="exampleLink" id="jsFactExLink" href="#">factorial</a> |<a class="exampleLink" id="jsDatatypesExLink" href="#">data types</a> |<a class="exampleLink" id="jsExceptionExLink" href="#">exception</a> |<a class="exampleLink" id="jsClosureExLink" href="#">closure</a> |<a class="exampleLink" id="jsShadowingExLink" href="#">shadowing</a> |<a class="exampleLink" id="jsConstructorExLink" href="#">constructor</a> |<a class="exampleLink" id="jsInhExLink" href="#">inheritance</a></p></div><div id="pyOutputPane"></div><div id="footer"><p><button id="genUrlBtn" class="smallBtn" type="button">Generate permanent link</button> <input type="text" id="urlOutput" size="70"/></p><p>Click the button above to create a permanent link to yourvisualization. To report a bug, paste the link along with a brief errordescription in an email addressed to philip@pgbovine.net</p><div id="embedLinkDiv"><p><button id="genEmbedBtn" class="smallBtn" type="button">Generate embed code</button> <input type="text" id="embedCodeOutput" size="70"/></p><p>To embed this visualization in your webpage, click the 'Generateembed code' button above and paste the resulting HTML code into yourwebpage. Adjust the height and width parameters andchange the link to <b>https://</b> if needed.</p></div><p style="margin-top: 25px;">This tool runs JavaScript in Node.js v6.0.0 with limited support for ES6. <ahref="https://github.com/pgbovine/OnlinePythonTutor/tree/master/v4-cokapi/backends/javascript">Backendsource code</a>.</p><p style="margin-top: 30px;">Privacy Policy: By using Online PythonTutor, your visualized code, options, user interactions, text chats, andIP address are logged on our server and may be analyzed for researchpurposes. Nearly all Web services collect this basic information fromusers. However, the Online Python Tutor website (pythontutor.com) doesnot collect any personal information or session state from users, nordoes it issue any cookies.</p><p style="margin-top: 25px;">Copyright © <a href="http://www.pgbovine.net/">Philip Guo</a>. All rights reserved.</p></div></body></html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。