Console - Reading Assignment

  1. The Console provides you with the ability to write, manage, and monitor JavaScript on demand.

  2. ctrl+Shift+j

  3. Console.log function allows you to log information within the console rather than in the browser.

  4. By using Javascript commands to change elements,tags, etc.

1 Like
  1. What is the console used for?
    The console is used to log information as part of the JavaScript development process, as well as allow you to interact with a web page by carrying out JavaScript expressions within the page’s context.

  2. How do you open the Console in Google Chrome?
    In Chrome: Menu -> More tools -> Developer Tools

  3. What does console.log function do?
    It allows the programmer to log data (or objects in most cases) to the JS Console.

  4. How can you change the contents of an HTML page through the console?
    By going to the Elements section in the Console and double clicking the element, tag, attribute you want to change.

1 Like
  1. What is the console used for?
    The Console provides you with the ability to write, manage, and monitor JavaScript on demand.

  2. How do you open the Console in Google Chrome?
    To open the JavaScript Console in Chrome, you can navigate to the menu at the top-right of your browser window signified by three vertical dots in a row. From there, you can select More Tools then Developer Tools. This will open a panel where you can click on Console along the top menu bar to bring up the JavaScript Console if it is not highlighted already. You can also enter into the JavaScript Console by using the keyboard shortcut CTRL + SHIFT + J.

  3. What does console.log function do?
    Rather than have pop-up alerts that we need to continue to click out of, we can work with JavaScript by logging it to the Console with console.log.

  4. How can you change the contents of an HTML page through the console?
    Via the DOM by using JavaScript commands to edit the HTML page.

1 Like
  1. The console is used for analyzing the code that is in a page, and it allows you to mess around with the html code.
  2. You press ctrl + shift + J
  3. Console.log function allows you to display text in Javascript log
  4. You can use the Javascript log to edit html code.
1 Like

Hi, I am having trouble understanding the practice exercise more variables.
on the last question:
Shopping trip.
Write a script, the script should calculate the total price for a user after a shopping trip.
The items that can be bought are bread, milk, cheese, and yogurt.

The prices are as follows:
Bread: € 2.
Milk: € 1.5.
Cheese: € 4.
Yogurt: € 1.2.
i did this script but on the answer it is different. is this ok? because it is the same output.
“var Bread = 2 ;
var Milk = 1.5;
var Cheese = 4;
var Yogurt = 1.2;
alert(“what do you want to buy?”) ; var b = prompt(“how much bread?”) ; console.log(b); var m = prompt(“how much milk?”) ; console.log(m) ; var c = prompt(“how much cheese?”); console.log©; var y = prompt(“how much yogurt?”) ; console.log(y); alert(“your total is:” + ((b * Bread) + (m * Milk) + (c * Cheese) + (y * Yougurt)))”
Could anyone explain why is the solution like
var bread = 2;
var milk = 1.5;
var cheese = 4;
var yogurt = 1.2;
var sum = 0;
alert(“Hi! Welcome to the Ivan on Tech Shop!”);
var input = prompt(“How much bread do you want?”);
sum += input * bread;
var input = prompt(“How much milk (liter) do you want?”);
sum += input * milk;
var input = prompt(“How much cheese do you want”);
sum += input * cheese;
var input = prompt(“How many yogurts do you want?”);
sum += input * yogurt;
console.log(“The total amount to pay is”, sum);

What is the console used for?

The console is the place where you can interact and read information about the current web page. IT helps in debugging and inspecting how the page is set up.

How do you open the Console in Google Chrome?

On Mac OS X with Chrome, you can open the Console with Command Option J

What does console.log function do?

It sends output to the console and also allows sending commands and other instructions to the console.

How can you change the contents of an HTML page through the console?

You can do that through commands and instructions that modifiy the DOM layout of the target page.

1 Like

Reading Assignment: Console

  1. What is the console used for?
  2. How do you open the Console in Google Chrome?
  3. What does console.log function do?
  4. How can you change the contents of an HTML page through the console?

1- It is a tool built in to work with JavaScript and other web technologies. It basically allows you to interact with the page, monitor, manage and write on it.

2-Rigt Upper corner Lines à More Tools à Developer Tools, or Ctrl + Shift + J.

3- Allows you to issue JavaScript commands to the console or the browser.

4- Through the DOM, and altering the script in the console. (Not sure about this one, sorry)

1 Like
  1. provides the ability to write, manage, and monitor javascript
  2. top-right hand click on menu, more tools, developer tools, console
  3. console.log prevents the output from popping up
  4. you can experiment in console to modify html pages without changing the document once the page is reloaded
1 Like
  1. The Console provides you with the ability to write, manage, and monitor JavaScript on demand.
  2. To open the Console in Chrome, you can navigate to the menu at the top-right of your browser window signified by three vertical dots in a row. From there, you can select More Tools then Developer Tools.
  3. Console.log allows the programmer to log data to the JS Console.
  4. You can modify the contents of an HTML page by using the document element inside the console.
1 Like
  1. To livetest implementation of new code lines on a website
  2. Menu>more tools>developer tools
  3. console.log print out the function’s value onto the console
    4.Certain function allows you to modify the HTML lines
1 Like
  1. Console which is similar to a shell interface, along with tools to inspect the DOM, debug, and analyze network activity
  2. keyboard shortcut CTRL + SHIFT + J on Linux or Windows
  3. puts info into console
    4 yes, provides you with a space to experiment with modifying HTML page
1 Like

[quote=“ivan, post:1, topic:3109”]

  • What is the console used for?
    Is used to write, manage, and monitor JavaScript on demand.
  • How do you open the Console in Google Chrome?
    Click Menu then More tools then Dev tools then console tab.
  • What does console.log function do?
    Is used to print any kind of variables defined before in it or to just print any message that needs to be displayed.
  • How can you change the contents of an HTML page through the console?
    By using the innerHTML method. I need to practice more though.)
1 Like
  1. What is the console used for? Dev tools for website developers

  2. How do you open the Console in Google Chrome? Menu at the top right> more tools> dev tools

  3. What does console.log function do? Displays whatever function we program into it

  4. How can you change the contents of an HTML page through the console? by opening the console and implementing your own javascript. It won’t stick but will last while you’re on your current session loaded on screen.

1 Like
  1. What is the console used for?
    The console is used as a tool to write code within the context of a modern web browser.

  2. How do you open the Console in Google Chrome?
    Navigate to the menu at the top-right of your browser, click on the three vertical dots in a row, click more tools and click developer tools.
    Shortcut is Command + option (alt) + J

  3. What does console.log function do?
    The console.log function prints any kind of variables before in it or to print any message that needs to be displayed to the user.

How can you change the contents of an HTML page through the console?
By uploading the HTML file and opening the console in the web browser.

1 Like

1:log info as well as interact with web page
2:linux and windows CTRL+SHIFT+J macos command+options+J
3:logs it to the console
4:right click page inspect element but remember to save elsewhere or it will be reverted back once reloaded

1 Like
  1. the console can be used to log information as part of the JavaScript development process, as well as allow you to interact with a web page by carrying out JavaScript expressions within the page’s context.

Essentially, the Console provides you with the ability to write, manage, and monitor JavaScript on demand.

  1. To open the console in Chrome, you can navigate to the menu at the top-right of your browser window signified by three vertical dots in a row. From there, you can select More Tools then Developer Tools.

    This will open a panel where you can click on Console along the top menu bar to bring up the JavaScript Console if it is not highlighted already.

  2. the console allows you to issue java script commands directly to the browser or the console itself.

  3. you can use elements such as document.createElement() to modify html code on page

1 Like
  1. The console is similar to a shell interface and allows you to log information as part of the JavaScript development process. It provides you the ability to write, manage and monitor JavaScript on demand.
  2. Click three dots in top right corner and click More tools, then click Developer tools and choose console in top tabs.
  3. console.log provides an output to the console, so you can see how changes will effect webpage and can add text, dates, compute math problems, etc.,
  4. The console provides a space to try out JavaScript code in real time, similar to a terminal shell interface, which can be utilized on an HTML page, so long as you save changes elsewhere!
1 Like
  1. What is the console used for?
    It is used to write, manage and monitor JavaScript on demand.
  2. How do you open the Console in Google Chrome?
    (Command + Option + J) in Mac and (Control + Shift + J) in Linux/Windows.
  3. What does console.log function do?
    It prints defined variables or intended message for the user.
  4. How can you change the contents of an HTML page through the console?
    Through the DOM (Elements tab).
1 Like

What is the console used for?
it’s used to Debuggin code: (Inspect JS objects or code, write and test your own code and test it locally, Manipulate DOM, etc.)

How do you open the Console in Google Chrome?
Control + Shift + J

What does console.log function do?
Put info to the console if you need to check any variable or result.

How can you change the contents of an HTML page through the console?
right click over the element that you want to change and select “inspect”

1 Like
  1. What is the console used for?
    It executes (writes out) the commands to visualize

  2. How do you open the Console in Google Chrome?
    CTRL + SHIFT + J

  3. What does console.log function do?
    It prints the result of evaluating an expression

  4. How can you change the contents of an HTML page through the console?
    Edit the DOM elements

1 Like