how do i solve this in task 99
task 99
sammybaks show your code and the submission result, please.
Or else you can skip this task and get back to it later.
igual estoy atorado en esta
// add constants
export const rideSpeed = 10
export const rideTime = 5
//add imports and console.log
import { rideSpeed, rideTime} from "./constants";
const distance = rideSpeed + rideTime
console.log(distance)
Andru distance is the product (not the sum!) of time and speed
Coderslang_Master Thanks <3
import { rideSpeed,rideTime } from "./constant.js";
My code is not working .Below is the error
In the file solution.js`` console.log must be called once
In the file solution.js, console.log must take the calculated distance as an argument
function distance(a,b){
return a * b
}
const dist = distance(rideSpeed * rideTime)
console.log(dist)
//--------constants.js----
export const rideSpeed = 4;
export const rideTime = 6;
//----------solution.js------
import {rideSpeed, rideTime} from './constants.js'
function distance(a,b){
return a+b;
}
console.log(distance(rideSpeed,rideTime))
output: error:
In the file solution.js, console.log must take the calculated distance as an argument
hareesh the distance is calculated as a product of speed and time, not their sum.
function getDistance(speed, time){
return speed * time;
}