print r in javascript

To print the value of a variable r in JavaScript, you can use console.log() function. Here's an example:

index.tsx
let r = "Hello";
console.log(r); // prints "Hello" in the console
66 chars
3 lines

In this example, we declare a variable r and assign it the value "Hello". We then use console.log() to print the value of r to the console.

You can also use document.write() method to display the value of r on the web page. Here's an example:

index.tsx
let r = "Hello";
document.write(r); // displays "Hello" on the web page
72 chars
3 lines

In this example, we declare a variable r and assign it the value "Hello". We then use document.write() to display the value of r on the web page.

gistlibby LogSnag