From ed5041d5e129aea6f7f1159a884a2c08ab0aea70 Mon Sep 17 00:00:00 2001 From: Exercism's Solution Syncer Bot <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 00:11:13 +0000 Subject: [PATCH 1/2] [Sync Iteration] javascript/hello-world/1 --- solutions/javascript/hello-world/1/hello-world.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 solutions/javascript/hello-world/1/hello-world.js diff --git a/solutions/javascript/hello-world/1/hello-world.js b/solutions/javascript/hello-world/1/hello-world.js new file mode 100644 index 0000000..ea2b2c7 --- /dev/null +++ b/solutions/javascript/hello-world/1/hello-world.js @@ -0,0 +1,8 @@ +// +// This is only a SKELETON file for the 'Hello World' exercise. It's been provided as a +// convenience to get you started writing code faster. +// + +export function hello() { + return "Hello, World!"; +} From d0463f2888f8531658e858af11c1975aa9450069 Mon Sep 17 00:00:00 2001 From: Exercism's Solution Syncer Bot <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 00:11:13 +0000 Subject: [PATCH 2/2] [Sync Iteration] javascript/lasagna/1 --- solutions/javascript/lasagna/1/lasagna.js | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 solutions/javascript/lasagna/1/lasagna.js diff --git a/solutions/javascript/lasagna/1/lasagna.js b/solutions/javascript/lasagna/1/lasagna.js new file mode 100644 index 0000000..a977717 --- /dev/null +++ b/solutions/javascript/lasagna/1/lasagna.js @@ -0,0 +1,70 @@ +// @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; +export const EXPECTED_MINUTES_IN_OVEN = 40; + +/** + * 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) { +return EXPECTED_MINUTES_IN_OVEN - actualMinutesInOven +} + +/** + * Given a number of layers, determines the total preparation time. + * + * @param {number} numberOfLayers + * @returns {number} the total preparation time + */ +export function preparationTimeInMinutes(numberOfLayers) { + return numberOfLayers * PREPARATION_MINUTES_PER_LAYER; +} + +/** + * 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 preparationTimeInMinutes(numberOfLayers)+ actualMinutesInOven +}