7/13 in what appears to be an infinite loop


#1

I have attempted numerous variations on what I think the correct answer is - no matter what I do, when I press RUN it goes into what appears to be an infinite loop.>



var React = require('react');
var ReactDOM = require('react-dom');
var Button = require('./Button');


var Talker = React.createClass({
 talk: function () {
  for (var speech = '', i = 0; i < 10000; i++) {
    speech += 'blah ';
  }
  alert(speech);
},

  render: function () {
    return <Button onClick={this.talk} />;
  }
});

ReactDOM.render(
  <Talker />,
  document.getElementById('app')
);


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.