Java script (Console)

Tags:

Javascript and python have many more similarities than I would have thought. So, that made it much easier for me to catch on to Javascript. I will be focusing today on Console. The easiest way for me to to describe Console is by comparing it to print. For example to print a number in python you would have to write:

print(100)

to print a number in Javascript you would have to write

console.log(100)

Here are some things compared in python and Javascript:

console.log('hello world') ----> print('hello world')

You can also alter how the things you have in your Console look. For example:

const styles = 'padding: 10px; background-color: white; color: green'
console.log('%cHello World' styles)

This would print text that is green and a background that is white. Console is very similar to print and was very easy for me to catch on to.

Categories

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *