From bda8173932892acf5287dbf5441d3d0cf9147b91 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 28 Oct 2024 16:08:46 +0200 Subject: [PATCH] Improve the sample code --- .../type_widgets/options/appearance/code_block.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/appearance/code_block.js b/src/public/app/widgets/type_widgets/options/appearance/code_block.js index d974ccbef..05a909984 100644 --- a/src/public/app/widgets/type_widgets/options/appearance/code_block.js +++ b/src/public/app/widgets/type_widgets/options/appearance/code_block.js @@ -5,10 +5,13 @@ import OptionsWidget from "../options_widget.js"; const SAMPLE_LANGUAGE = "javascript"; const SAMPLE_CODE = `\ -function test(name) { - console.log("Works"); - console.info("Test"); - // Hello world. +const n = 10; +greet(n); // Print "Hello World" for n times + +function greet(times) { + for (let i = 0; i++; i < times) { + console.log("Hello World!"); + } } `