Skip to content

Tag: arrays

Get size of array returned by map in React render

I’m using array.map in my render method of a React component. It works but I want to know how many rows it’s rendering. I’m trying by initialising this.numRows = 0 in my constructor, then incrementing it in the map callback: But this is still showing zero. Full code here: jsfiddle.net/ra13jx…

Basic Profile Lookup always returning no contact found

So I’ve recently begun learning Javascript using the tutorials on freecodecamp and there’s this challenge I’ve been stuck on for a few hours now. The function always returns ‘No contact found’ and I don’t understand why. If someone were to explain it to me and correct my co…