Im starting to learn some JS and I want to understand how should I create class with inheritance,after I read some articles and post in SO Im little bit confuse about how to implement it in the right... i've created the following very simple example to understand it better but Im not sure that this is the right way therefore I write this post.
1. since Im coming from OOP language this is the right way to create class with two different object that using the same functionality ?
http://plnkr.co/edit/NCJs9jdKP5o0mwp6SuBD?p=info
2. In some JS files I saw the regular way to create function which I understand
function fnName(){
console.log("test");
}
and in some files I saw function like following
say:function(){
console.log("say something")
}
what are the difference between those two ways to define function?
I tried sometimes to use it and I got error function name is missing,any idea when I can use this and when not ?