Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please modify the following javascript so that instead of displaying in the console, it displays on a webpage. // Assign person's age to myAge variable

Please modify the following javascript so that instead of displaying in the console, it displays on a webpage.

// Assign person's age to myAge variable

let myAge = 30;

// Assign value 2 to earlyYears variable

let earlyYears = 2;

// Multiply earlyYears by 10.5 and reassign it to earlyYears

earlyYears *= 10.5;

// Calculate laterYears by subtracting 2 from myAge

let laterYears = myAge - 2;

// Multiply laterYears by 4

laterYears *= 4;

// Add earlyYears and laterYears and assign it to myAgeInDogYears

let myAgeInDogYears = earlyYears + laterYears;

// Assign person's name to myName variable and convert it to lowercase

let myName = 'John'.toLowerCase();

// Output the result

console.log(`My name is ${myName}. I am ${myAgeInDogYears} years old in dog years`);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Define a statement of net worth and a statement of cash flows.

Answered: 1 week ago