Core Fundamentals of Web Development Part 6 - ES6 Arrow Functions and the This Keyword

preview_player
Показать описание
In this video, we will add functionality to the add button of our form. When the user submits the form, we will extract the form input, create a new "Link" object from that input, and add it to an array. As we do this, we will update our callback function syntax from using traditional callbacks to use ES6 Arrow Functions and discuss its impact on the This keyword.

### References

-~-~~-~~~-~~-~-
Please watch: "5 Ways To Improve Your Speed With Visual Studio Code"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

I just wanted to know, without `querySelector` (on input ids), how `linkTitle` and `linkUrl` are giving value of the input in the below function.

submitButton.addEventListener('click', (event) => {
const title = linkTitle.value;
const url = linkUrl.value;
const categories = linkCategories;

const newLink = {
title,
url,
categories,
};
console.log(newLink);
event.preventDefault();
});

sinhasagar
Автор

So I’m getting errors that linkTitle and linkUrl are undefined. Which makes sense. Am I miss something? You have no have errors

justpassingbylearning
welcome to shbcf.ru