Message from JavaScript discussions
December 2017
— I think js is a good language to build neural networks.
This is an article about it.
“How to create a Neural Network in JavaScript in only 30 lines of code” perborgen https://medium.freecodecamp.org/how-to-create-a-neural-network-in-javascript-in-only-30-lines-of-code-343dafc50d49
— Thanx
— Function Question(question,answer,correct) {
this.question=question;
this.answer=answer;
this.correct=correct;
}
Question.prototype.displayQuestion =
function() {
console.log(this.question);
for(var i=0;i<this.answers.length;i++){
console.log(i + ":" + this.answers[i]);
}
}
Question.prototype.checkAnswer = function(ans) {
if(ans === this.correct){
console.log("Correct");
}else{
console.log("Wrong");
}
}
var q1 = new Question("Which language does it coded?",['JavaScript','Java','C++'],0);
var q2 = new Question("Which field are you into?",['Computer','Mechanical','Civil'],0);
var q3 = new Question("In which city do you study?",['Bardoli','Ahmedabad','Surat'],1);
var questions = [q1, q2, q3];
var n = Math.floor(Math.random()*questions.length);
questions[n].dispalyQuestion();
var ans = parseInt(prompt("Give the correct answer!"));
questions[n].checkAnswer(ans);
— Can anyone help me to solve the error?
— Type error in displayQuestion is not a function it is showing that
— No that was not an error
— I spelled wrong diplay word as dispaly .
— A small silly mistake.
— It took hours of time.
— Yes anything that can do math is a working lang for ANNs
— The most basic is just a tensor field