Hot answers tagged

2

From a short review; Please follow the lowerCamelCase naming convention, user_settings -> userSettings In production code, never use console.log or alert You set optionB twice var default_settings = { optionA: "abc", optionB: 123, optionB: true }; The cyclomatic complexity would be lower if you exit ...


2

In general the template looks like a good start. I noticed that the code appears to resemble the format advised in PHP-Fig's PSR-2, namely "The opening brace MUST go on its own line"1 for functions and methods plus control structures like if and else blocks. Most of the Javascript style guides I have seen call for curly braces to exist on the same line of ...


2

The code already uses some ecmascript-6 features like the const and let keywords and template literals. Another ES-6 feature that could be used is the for...of loop to simplify blocks like this: for (let i = 0; i < items.length; i++) { movies += template .replace('{title}', items[i].title) .replace('{description}', items[i]....


2

From a short review; patient is a global variable, global variables are bad var patient = [] is more idiomatic than var patient = new Array(); Comments should be all German or all English (I would go for all English, its the common language of the developers) You can group switch labels, this is valid JavaScript: switch(key){ case "id": ...


1

Duplicated Ids!!! 😲 I notice in the comments there is mention of more than 1 element with the same Id and that getElementById will only return one element, which is correct for the majority of browsers depending on the version. Even if getElementById acted the same across browsers As a developer intentionally using duplicated Id is VERY BAD! as it will ...


Only top voted, non community-wiki answers of a minimum length are eligible