We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e2b24b8 + 333d752 commit 2eddaddCopy full SHA for 2eddadd
src/index.js
@@ -17,6 +17,13 @@ document.addEventListener('DOMContentLoaded', function() {
17
// Get question title
18
var questionTitle = document.getElementById('questionTitle').value;
19
20
+ // Check that question title is not a duplicate, even if case is different
21
+ const duplicateQuestion = questions.find(q => q.title.toLowerCase() === questionTitle.toLowerCase());
22
+ if (duplicateQuestion !== undefined) {
23
+ alert('Question title already exists');
24
+ return;
25
+ }
26
+
27
// Get question category
28
var questionCategory = document.getElementById('questionCategory').value;
29
0 commit comments