‫Hello, and this lecture will cover some basic JavaScript syntax.
‫Let's start by writing our first HelloWallet in Google search engine code editor.
‫All right, a print Hanawalt and click run here.
‫Here you go.
‫I'll see a hell of word on the console.
‫So this is literally our first quad JavaScript code on Google Earth engine called ED.
‫JavaScript syntax have different parameters or characteristics, including string numbers, lists,
‫objects or dictionaries and functions.
‫Let's start with strings, strings.
‫We can use our devel or a single quotation.
‫For example, here you will write a declare variable called test string and that I'll define Google
‫Earth engine string.
‫So to print that, to return that, I'll write of a print test string which is already defined here.
‫And if I run, then it should give me Google Earth engine.
‫So that's one way to write to declare strengths in JavaScript.
‫Next, we can declare numbers using variable.
‫For example, here.
‫In this case I define a variable.
‫No, I will sign that 999 and I'll print that that variable, which is a number and run that it should
‫give me the number 999 on the console.
‫Let's run that.
‫Here you go.
‫I have my answer is nine.
‫So my answer is here as a string and fireball, which is a number here declared.
‫And the next parameter in JavaScript is least we can define lists using square brackets.
‫So let's define our list, which is called my list viable and we can define anything, but in this case,
‫a number.
‫So in this list, I have numbers ranging from there to five.
‫Let's print that list and print list of numbers.
‫You can write anything here.
‫Just it's a text for you to be able to remember what is that variable?
‫Because you have a number a lot of prints here.
‫So just you want you want to be able to differentiate the different print.
‫So here you can write any text that that helps you to remember what that specific print is.
‫So here in this case, we will like print this my list.
‫I'll run that.
‫And it should give me these list numbers ranging from zero to five.
‫Feargal.
‫Here's my list.
‫If I click, then I'll have numbers from there to five.
‫OK, the next thing is objects in JavaScript or dictionaries.
‫You can define that using curly bracket.
‫So let's define our dictionary here.
‫So I'll I'll define a variable called my object, which is my dictionary using a curly bracket here
‫and I'll define different.
‫You can define anything in your dictionary here.
‫In this case, I define a b y o just as this is just a variable.
‫And in that I'll I'll define a string called try and another variable is Nota, which is a number 13.
‫And also I have another variable declared item which has a list of strings and then I'll close my dictionary
‫using a curly bracket and semicolon to close that statement and I'll print my dictionary.
‫I can write here, this is my dictionary and I'll call that dictionary here, which is my object.
‫I'll run that.
‫So I should be able to get all these items in that dictionary and then run that.
‫Here we go.
‫So my dictionary here, I have all the items listed in that dictionary.
‫Finally in JavaScript, we have functions.
‫Functions will help us to optimize reputed applications.
‫So in this case, a very simple, basic function called.
‫It is equal to function and I'll have that element or an input into that function and a curly bracket
‫again and return so it will return anything that you define.
‫This is pretty basic in a function in the upcoming lectures will only introduce you to some advanced
‫functions to process and analyze geospatial data.