Skip to content

Commit cf00fa1

Browse files
committed
Add in a couple missing var keywords to JS todo curriculum
1 parent fa380b0 commit cf00fa1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sites/en/javascript-to-do-list/adding_an_item.step

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ steps do
3636

3737
source_code :javascript, <<-JAVASCRIPT
3838
$('#add-form').on('submit', function(event) {
39-
itemDescription = event.target.itemDescription.value
39+
var itemDescription = event.target.itemDescription.value
4040
alert('trying to create a new item with a description ' + itemDescription)
4141
})
4242
JAVASCRIPT
@@ -107,7 +107,7 @@ explanation do
107107
source_code :javascript, <<-JAVASCRIPT
108108
$('#add-form').on('submit', function(event) {
109109
event.preventDefault()
110-
itemDescription = event.target.itemDescription.value
110+
var itemDescription = event.target.itemDescription.value
111111
var creationRequest = $.ajax({
112112
type: 'POST',
113113
url: "https://listalous.herokuapp.com/lists/YOUR-LIST-NAME-HERE/items",

sites/en/javascript-to-do-list/marking_an_item_as_complete.step

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Refresh the page and try completing an item. An alert should pop up!
4545

4646
source_code :javascript, <<-JAVASCRIPT
4747
var item = $(event.target).parent()
48-
isItemCompleted = item.hasClass('completed')
48+
var isItemCompleted = item.hasClass('completed')
4949
var itemId = item.attr('data-id')
5050
alert('clicked item ' + itemId + ', which has completed currently set to ' + isItemCompleted)
5151
JAVASCRIPT
@@ -112,7 +112,7 @@ explanation do
112112
source_code :javascript, <<-JAVASCRIPT
113113
$('#list').on('click', '.complete-button', function(event) {
114114
var item = $(event.target).parent()
115-
isItemCompleted = item.hasClass('completed')
115+
var isItemCompleted = item.hasClass('completed')
116116
var itemId = item.attr('data-id')
117117

118118
var updateRequest = $.ajax({

0 commit comments

Comments
 (0)