JavaScript Treehouse Club - MASH MASH - JavaScript Handle Submission and Event Handler Functions

Nafis Fuad
Nafis Fuad
35,503 Points

Not getting what things a function needs to work.

So can anyone tell me the things I need to learn to make a function work? and frankly speaking, I simply don't understand functions.

4 Answers

Steven Parker
Steven Parker
172,106 Points

A function is basically a "subprogram".

It can be called on to run by another part of the program (including from a function). Like the program itself, it contains a sequence of statements to be performed.

Optionally, a function can be given (we usually say "passed") one or more values to work with. And when it finishes, it can return a value back to the part of the program that called it.

Nafis Fuad
Nafis Fuad
35,503 Points

is there any book that'll help me get a good grip on javascript?

Steven Parker
Steven Parker
172,106 Points

Plenty, but they differ so much in style it might be good for you to look at some sample pages and see which might appeal to you the most. You might try browsing Amazon, they often offer sample pages to read for their books.

I wouldn't neglect your local library. They may not have the very most current editions with the latest features, but most of the fundamentals of JavaScript are the same as they always have been.

Also, concepts like "function" are common to most programming languages. You might also look for topics like "basic computer programming" that aren't language-specific.

Tina Bryan Maddox
Tina Bryan Maddox
28,102 Points

Hello Nafis,

I too was in the same place you are when I began learning JavaScript. I have just completed the Full Stack JavaScript track here on Treehouse and highly recommend it.

I have several books on the subject but find JavaScript the Good Parts to be most helpful. It was recommended by senior developers within my community and is free to download. It should be most helpful as you continue your studies.

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwjW8YeC_5LTAhVD44MKHaN8A_0QFggcMAA&url=http%3A%2F%2Fbdcampbell.net%2Fjavascript%2Fbook%2Fjavascript_the_good_parts.pdf&usg=AFQjCNHt53ytjA-wtzHM7nkTyYXvUHM0Kg&sig2=jEyAB-KmRjdsGRn37qKOpQ

Please let me know if you have any questions.

Tina :)

Steven Parker
Steven Parker
172,106 Points

That's an old but still good book, and free to download. But just be aware that Douglas Crockford has revised his opinions slightly since then, as he has stated in more recent publications and conference presentations. Some of his conference presentations are available on YouTube.

Nafis Fuad
Nafis Fuad
35,503 Points

I'll surely read that book.