The lasagna is burning/undercooked

:wave: Hello, I’m new to java script programming and i just got this error but it gave me nothing for the error

If you share your code as text in a codeblock, that would enable us to copy/paste and debug it :slight_smile:

export const EXPECTED_MINUTES_IN_OVEN = 40
  throw new Error('')

It’s usually best to share the entire file when asking for help as other lines of code are often related to the problem.

What does this line do? What is its purpose?

i made it because all the other lines of code had it.

// @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
 */
export function remainingMinutesInOven(actualMinutesInOven) {
  throw new Error('Remove this line and implement the function');
}

/**
 * Given a number of layers, determines the total preparation time.
 *
 * @param {number} numberOfLayers
 * @returns {number} the total preparation time
 */
export function preparationTimeInMinutes(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) {
  throw new Error('Remove this line and implement the function');
}

export const EXPECTED_MINUTES_IN_OVEN = 40
  throw new Error('')

I don’t know for sure though.

If you’re not sure if something is needed in code, it’s often a good idea to just try removing it and running the tests. Programs should only contain code that serves a specific purpose.

it worked however I now have a new problem

Click where is says “FAILED” on the right. Does it show more details?

No, instead the arrow shifts to the right and then back down

I’m not sure why the test details aren’t showing but you should probably follow the instructions given there.

/**
 * 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
 */
export function remainingMinutesInOven(actualMinutesInOven) {
  throw new Error(30);
}

/**
 * Given a number of layers, determines the total preparation time.
 *
 * @param {number} numberOfLayers
 * @returns {number} the total preparation time
 */
export function preparationTimeInMinutes(numberOfLayers) {
  throw new Error(2);
}

/**
 * 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) {
  throw new Error(3,20);
}

export const EXPECTED_MINUTES_IN_OVEN = 40

I added the function which was 30 but instead accounted it as a test failure.

The function isn’t suppose to throw an error. It’s supposed to return a value.

Could it be because of the error

Yes. It’s because the code is throwing an error. It’s not supposed to throw an error. It’s supposed to return a number.

The color of my code is different then the color in the instructions panel

`export function remainingMinutesInOven(actualMinutesInOven) {
throw new Error(30);
}`

this could be the problem
image

Different tools color code differently. We use markdown rendering for the docs and CodeMirror for the code editor. The colors won’t necessarily line up (and probably won’t). The color doesn’t affect the behavior of the code; Javascript reads the text, not the color, and runs the code.

Your code is throwing an error. You need to change it to not throw an error.