create account

Lasagna! by drago18121996

View this thread on: hive.blogpeakd.comecency.com
· @drago18121996 ·
$0.06
Lasagna!
// @ts-check

//

// ☝🏽 The line above enables type checking for this file. Various IDEs interpret

// the @ts-check directive. It will give you helpful autocompletion on the web

// and supported IDEs when implementing this exercise. You don't need to

// understand types, JSDoc, or TypeScript in order to complete this JavaScript

// exercise, and can completely ignore this comment block and directive.

​

// 👋🏽 Hi there!

//

// On the JavaScript track we provide you with stubs. These stubs provide a

// starting point to solving the exercise.

//

// In general, each variable/constant and each declared function will have a

// JSDoc comment block above it, explaining what the variable/constant holds or

// the function is supposed to accomplish.

//

// 💡 Often, the JSDoc comment blocks have annotations, such as @param and

// @returns which are usually highlighted with a different color if the IDE

// you're in recognizes them. It's these annotations that are used when

// referring to the constant, variable, or function from somewhere else that

// IDEs display.

//

// You don't need to write these yourself; it is not expected in idiomatic

// JavaScript, but some companies and style-guides do enforce them.

//

// 💡 You're allowed to completely clear a stub before you get started. Often

// we recommend using the stub, because they are already set-up correctly to

// work with the tests, which you can find in ./lasagna.spec.js

//

// Good luck preparing some lasagna!

​

/\*\*

 \* The number of minutes it takes to prepare a single layer.

 \*/

const PREPARATION\_MINUTES\_PER\_LAYER = 2;

​

​

/\*\*

 \* Determines the number of minutes the lasagna still needs to remain in the

 \* oven to be properly prepared.

 \*

 \* @param {number} actualMinutesInOven

 \* @returns {number} the number of minutes remaining

 \*/

​

​

/\*\*

 \* Given a number of layers, determines the total preparation time.

 \*

 \* @param {number} numberOfLayers

 \* @returns {number} the total preparation time

 \*/

​

​

export const EXPECTED\_MINUTES\_IN\_OVEN= 40;

​

export function remainingMinutesInOven(actualMinutesInOven) {

  return EXPECTED\_MINUTES\_IN\_OVEN-actualMinutesInOven;

  throw new Error('Remove this line and implement the function');

}

​

export function preparationTimeInMinutes(numberOfLayers) {

  return PREPARATION\_MINUTES\_PER\_LAYER\*numberOfLayers;

  throw new Error('Remove this line and implement the function');

}

​

​

​

/\*\*

 \* Calculates the total working time. That is, the time to prepare all the layers

 \* of lasagna, and the time already spent in the oven.

 \*

 \* @param {number} numberOfLayers

 \* @param {number} actualMinutesInOven

 \* @returns {number} the total working time

 \*/

export function totalTimeInMinutes(numberOfLayers, actualMinutesInOven) {

  return actualMinutesInOven+preparationTimeInMinutes(numberOfLayers)

  throw new Error('Remove this line and implement the function');

}

​
👍  , , , , , , ,
properties (23)
authordrago18121996
permlinklasagna
categoryita
json_metadata{"tags":["ita","life","live","information","science","programming"],"users":["ts-check","param","returns"],"app":"hiveblog/0.1","format":"html"}
created2024-03-20 09:14:54
last_update2024-03-20 09:14:54
depth0
children0
last_payout2024-03-27 09:14:54
cashout_time1969-12-31 23:59:59
total_payout_value0.028 HBD
curator_payout_value0.027 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,988
author_reputation173,713,325,386,734
root_titleLasagna!
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id132,191,804
net_rshares113,852,102,407
author_curate_reward""
vote details (8)