简体   繁体   English

允许直接在Visual Studio中运行javascript代码

[英]allow to run javascript code right in visual studio

Sometimes i need to write a couple of lines of code on javascript just to check how it works or try some algorithm. 有时我需要在javascript上写几行代码,只是为了检查其工作方式或尝试某种算法。 I use VS as primary tool, and it looks annoying for me that I can't run javascript code right in VS in REPL manner, like Ruby for example. 我使用VS作为主要工具,但我无法以REPL方式在VS中以正确的方式运行javascript代码(例如Ruby),这让我很烦。

So my question: is it possible to run javascript right from VS, maybe it's possible to to that with some plugins or add compiler. 所以我的问题是:是否可以从VS直接运行javascript,也许可以通过一些插件或添加编译器来实现。

Its really simple to do so. 这样做非常简单。 IE provides debugger tools. IE提供调试器工具。 There are many ways to do this. 有很多方法可以做到这一点。

Here is a list of things I would possibly do 这是我可能会做的事情的清单

  1. Use Chrome by simply pressing F12 and clicking on console for REPL (The debugged and REPL have fantastic features) 只需按F12并在控制台上单击REPL,即可使用Chrome(已调试和REPL具有出色的功能)
  2. Use IE by simple pressing F12 too. 只需按F12即可使用IE。 It support breakpoints and the feel is very similar to Visual studio. 它支持断点,并且感觉与Visual Studio非常相似。
  3. Use visual studio immediate window. 使用Visual Studio即时窗口。

Hope this helps. 希望这可以帮助。 Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM