Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9188813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:06:12+00:00 2026-06-17T20:06:12+00:00

I have module like this in node js var types = function (){ var

  • 0

I have module like this in node js

var types =  function (){

  var typeList= new Array();
  typeList[0] = "varchar";

  var numericDTs= new Array();
  numericDTs[0] = "tinyint";

  var binaryDTs= new Array();
  binaryDTs[0] = "tinyblob";

  var data = array();
  data[0] = typeList;
  data[1] = numericDTs;
  data[2] = binaryDTs;

  return data;
}

module.exports = {
  types: types,
}

i am calling this module like this

var types = require("./include/types");
console.log(types.types());

i got error like this
500 ReferenceError: array is not defined
no error if i return only types or typeList or binaryDTs.
How return array of arrays in node js?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:06:13+00:00Added an answer on June 17, 2026 at 8:06 pm

    Your error is here:

    var data = array();
    

    Write the following instead:

    var date = [];
    

    Actually replace every new Array() with [].

    Instead of

    var typeList= new Array();
    typeList[0] = "varchar";
    

    write var typeList = [ "varchar" ]; and so on.

    EDIT:

    Actually your whole function can be reduced to:

    var types = function() {
         return [ [ "varchar" ], [ "tinyint" ], [ "tinyblob" ] ];
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you have a stateful Node.js module? Like: exports.connectionsCache = new (function () {
I have a node.js module like this: # couchdb.js var couchdb = { //
I have a setup like this. var element = $(.module-panel, this.el); $('.module-panel:not('+element+')').hide(); What I'm
I have a directory structure like this: node_modules/mymodule/index.js : module.exports = require('./lib/mymodule'); node_modules/mymodule/lib/mymodule.js var
So I have something like this: module top (..., out,...); ... output [0:1] out;
I have a method in a url rewriting module that looks like this public
Let's say we have code looks like this module TM def aa puts aa
I have a node app that has a string of require s, like this:
Drupal 6.x I have this module that manages four different content types. For that
I'm a little new to drupal but have been using things like devel module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.