Jump to content

User talk:FlyDragon792

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Debates of any kind (keep it civil and don't attack each other) may be made on this page.

document.write is not newer than console.log

[edit]

`document.write` can be used to `eval(arbitrary malicious code)`, for example https://js.do/celiasnt/noooodocumentwrite

Also see image right.

Try document.write in the console and you get this message

`console.log` isn't deprecated or old or anything, it's literally what you're supposed to use! It can do a lot of things https://stackoverflow.com/questions/7505623/colors-in-javascript-console not to mention all the other methods of console https://developer.mozilla.org/en-US/docs/Web/API/console

(Note: I'm really worked up right now so sorry if this message isn't very good)  AltoStev (talk) 03:32, 9 December 2021 (UTC)[reply]

Document.write() is the current output code for JavaScript. When I coded in JavaScript for the first time a few months ago (learning about computer science in my college class), I tried to write a "Hello, world" program with console.log(). However, that didn't work, so I had to use document.write() to output a "Hello, world" program to the screen. Go try it out yourself at w3schools.com/js. FlyDragon792, 04:34, 10 December 2021 (UTC)[reply]

Hi! To follow up on this a bit, I noticed that you reverted a similar change. I had (a week-ish ago) had replied to your section in the talk page, apologies for not pinging you then. I think it might be worth discussing this because, for a few reasons, I do not think that document.write is the correct example for a JS hello world program. Looking forward to discussing this! Skynxnex (talk) 19:48, 2 February 2022 (UTC)[reply]
@FlyDragon792: Hi again! A friendly note that in general you shouldn't edit old talk page message that have already been replied to as you did in Special:Diff/1085129620. See WP:TALK#REPLIED. Skynxnex (talk) 17:32, 28 April 2022 (UTC)[reply]