<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tips for debugging Arcade scripts in VSCode/Node.js in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1152923#M52692</link>
    <description>&lt;P&gt;Personally, I almost always keep one of these two things up in a tab:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Arcade Playground&lt;/LI&gt;&lt;LI&gt;A "Test Space" dashboard pre-loaded with all sorts of datasets, widgets, and Data Expressions&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;As I work on a script in VSCode, I routinely copy it into one of these test spaces to get feedback. It's not perfect, but it works well enough.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 14:36:48 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-03-11T14:36:48Z</dc:date>
    <item>
      <title>Tips for debugging Arcade scripts in VSCode/Node.js</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1152905#M52690</link>
      <description>&lt;P data-unlink="true"&gt;What are some tips/tricks for &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/arcade-js-testing-in-vs-code-how-to-run-simple/m-p/1150508/highlight/true" target="_self"&gt;debugging&amp;nbsp;Arcade scripts&lt;/A&gt; in VS Code/Node.js?&lt;BR /&gt;(assuming that the Arcade script is fairly vanilla -- as in, it doesn't use many Arcade-specific functions&amp;nbsp; that need to be stripped-out)&lt;BR /&gt;&lt;BR /&gt;For example, Arcade uses &lt;FONT face="courier new,courier" color="#0000FF"&gt;console()&lt;/FONT&gt;, whereas&amp;nbsp;VS Code/Node.js uses &lt;FONT face="courier new,courier" color="#0000FF"&gt;console.log()&lt;/FONT&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Solution:&lt;BR /&gt;In VS Code, put &lt;A href="https://stackoverflow.com/questions/71438901/vs-code-node-js-use-console-instead-of-console-log" target="_self"&gt;this line at the top of the script:&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;console = Object.assign(console.log, console);&lt;/FONT&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;That will assign&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;console.log()&lt;/FONT&gt;&amp;nbsp;to&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;console()&lt;/FONT&gt;. Which means I can use the&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;console()&lt;/FONT&gt; script in both programs -- without constantly doing "find and replace" on &lt;FONT face="courier new,courier" color="#0000FF"&gt;.log&lt;/FONT&gt;.&lt;/LI&gt;&lt;LI&gt;Note: Only use that line in VS Code; it won't work in Arcade (and isn't needed in Arcade).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Any other ideas?&lt;BR /&gt;(I'm a novice, so it's possible the console.log() thing is wonky...I'm just trying to learn, and not get too frustrated while I'm at it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Related:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/developers-ideas/arcade-extension-for-visual-studio-code/idi-p/932261" target="_self"&gt;Idea: Arcade Extension for Visual Studio Code&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:13:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1152905#M52690</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-03-11T15:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tips for debugging Arcade scripts in VSCode/Node.js</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1152923#M52692</link>
      <description>&lt;P&gt;Personally, I almost always keep one of these two things up in a tab:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Arcade Playground&lt;/LI&gt;&lt;LI&gt;A "Test Space" dashboard pre-loaded with all sorts of datasets, widgets, and Data Expressions&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;As I work on a script in VSCode, I routinely copy it into one of these test spaces to get feedback. It's not perfect, but it works well enough.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 14:36:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1152923#M52692</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-11T14:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Tips for debugging Arcade scripts in VSCode/Node.js</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1153172#M52723</link>
      <description>&lt;P&gt;By the way, the keyboard shortcut for auto-formatting code in VS Code is:&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;Shift&lt;SPAN&gt; + &lt;/SPAN&gt;Alt&lt;SPAN&gt; + &lt;/SPAN&gt;F&lt;/FONT&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/a/29973358/5576771" target="_self"&gt;&lt;SPAN&gt;How do you format code in Visual Studio Code (VSCode)?&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 18:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/tips-for-debugging-arcade-scripts-in-vscode-node/m-p/1153172#M52723</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-03-12T18:05:12Z</dc:date>
    </item>
  </channel>
</rss>

