
Christopher Capasso
775 PointsVar vs function
I'm working through this class but in a different course I was studying to create a component you'd use var NAME = React.createClass ....
. Is there a difference?
3 Answers

Mikis Woodwinter
44,934 PointsHey Christopher,
It's just two types of architectures for creating a React Component. As you complete the course, the instructor will explain the differences between the two as well as the pros and the cons of each.

Christopher Capasso
775 PointsOk cool! I just wasn't sure if there was a difference. I'll just keep up with the course and see what I learn! Thank you!

Alexander Alegre
14,340 PointsThat syntax is just for React. Vanilla JavaScript if you want to create an object it would be "var name = new Object();". A function would be "function name = (parameters) {code;}" or you can assign it to a variable by "var x = function...." But it's just syntax differences.
Hope this helps.