question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

print() is executing the ctrl+p command.

See original GitHub issue

Challenge [Reverse a String](https://www.freecodecamp.com/challenges/reverse-a-string# has an issue. My code:

function reverseString(str) {
  **print("anythin");**
}
reverseString("hello");

Issue: The above code is executing the ctrl+p command. Or even if I am just typing print(); anywhere is the text editor. it is reproducing the same error. I am attaching the screenshot image

To reproduce the issue: Execute the above code. or just type print() in editor and execute it.

This issue is not limited to this problem only but it is reproducible at any problem.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
systimoticcommented, May 26, 2017

Hi @arthuragnar! Thank you for reporting this issue.

As you’re coming from Python, I can understand why you used print(). However, as described in the MDN page linked earlier, opening the print dialog is the correct behaviour when the print() function is called in Javascript. Therefore, I believe your code does what it should do, and this is not a bug with freeCodeCamp.

As this is not a bug with freeCodeCamp, I’m closing this issue. Again, thank you for reporting this issue, bug reports help us make freeCodeCamp better. Happy coding!

0reactions
dhcodescommented, May 21, 2017

This seems like a deep edge case. I think bike shedding imho.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to click CTRL+P using Java and selenium web driver?
If you are trying to print, this is working for me ((JavascriptExecutor) driver).executeScript("print()");.
Read more >
What Does Ctrl+P Do? - Computer Hope
On Apple computers, the keyboard shortcut for print is Command + P . How to use the Ctrl+P keyboard shortcut. Ctrl+P in an...
Read more >
ctrlp.vim ÷ home
Open multiple files at once. Create new files and directories. Execute Ex commands on an opening file (jump to a line, to a...
Read more >
How to print from a Windows computer (Ctrl + P) - Digital Citizen
Contents · 1. Press CTRL + P on your keyboard to print on Windows · 2. How to print on a Windows PC...
Read more >
PSA: If you're using CtrlP use this maintained fork : r/vim - Reddit
fh: search command history and execute. ... -prune -o -type d -print 2> /dev/null | fzf +m) && cd "$dir" } fh() {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found