Nothing here yet.
Nothing here yet.
No blogs yet.
I'm a mechatronics guy. So, if I would start a blog, it would result in a mix of OSS (Open Source Software) and OSH (Open Source Hardware). Maybe this contradicts to Hashnodes software concentrated audience. Is an overarching thematic spectrum welcome? Or off-topic articles?
They are the best JS books I know. They are written really beginner friendly but also cover advanced topics and insides of JS. Ideal if you're coming from another language. If JS is your first programming language you maybe should combine it with practical learning resources like Nodeschool . But it is definitely a must read.
What you want is to map. Not to filter. A filter only reduces the number of values in an array. const c = observers1.filter(item => a1 === a2) const observers = observers1. map (item => "hello" ) console. log (c) // [ 1, 2, 3, 5 ] console. log (observers) // [ 'hello', 'hello', 'hello', 'hello' ]
No, it's not. function Product ( name, price ) { this .name = name this .price = price } function Toy1 ( name, price ) { Product.call( this , name, price) this .category = 'toy' } function Toy2 ( name, price ) { Product.call(name, price) this .category = 'toy' } const robot1 = new Toy1( 'robot' , 40 ) const robot2 = new Toy2( 'robot' , 40 ) console .log(robot1) //Toy1 { name: 'robot', price: 40, category: 'toy' } console .log(robot2) //Toy2 { category: 'toy' } Please try to consult the documentation first if you don't understand something. Toy2 will create a Product on the name String, not on your new object.
const list = [ { "a" : "2" , "ss" : [ { "name" : "pourush" , "age" : "25" }, { "name" : "Mak" , "age" : "25" } ] }, { "b" : "3" , "ss" : [ { "name" : "James" , "age" : "19" }, { "name" : "shaun" , "age" : "20" } ] } ] function scan (list, key) { return list .reduce((a, b) => { let obj = b[key] || [] return a.concat(obj) }, []) } console.log(scan( list , 'ss' )) This is more dynamic. It also works with "a" or "b".