Skip to content

Improve test case of 4-do-while exercise #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Exercises/4-do-while.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
test: sum => {
const src = sum.toString();
if (!src.includes('while (')) throw new Error('Use while loop');
if (!src.includes('do {') || !src.includes('} while (')) throw new Error('Use do...while loop');
if (!src.includes('let')) throw new Error('Use let to define accumulator');
if (!src.includes('return')) throw new Error('Use return');
}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2021 How.Programming.Works contributors
Copyright (c) 2017-2023 How.Programming.Works contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Solutions/6-matrix.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const max = matrix => {
const max = (matrix) => {
let value = matrix[0][0];
for (let i = 0; i < matrix.length; i++) {
const row = matrix[i];
Expand Down
2 changes: 1 addition & 1 deletion Solutions/7-ages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const ages = persons => {
const ages = (persons) => {
const data = {};
for (const name in persons) {
const person = persons[name];
Expand Down