0

I'm writing a code in JavaScript the opens a file then read it:

var txtFile = "/dataset/happy.txt";
var fileH = new File(txtFile);
var fileS = new File("/dataset/sad.txt");
var fileA = new File("/dataset/angry.txt");
var fileSC = new File("/dataset/scared.txt");
var fileSU = new File("/dataset/suprised.txt");

fileH.open("r"); // open file with read access

But I get (ReferenceError: File is not defined) error What's the problem?

Thank you :)

mplungjan
  • 169,008
  • 28
  • 173
  • 236
user8423460
  • 125
  • 2
  • 12

0 Answers0