Most voted "undefined" questions
A variable is undefined if it has not been assigned a value. Use this tag for questions about the behavior of undefined variables or when you see undefined values where you don’t expect them.
Learn more…51 questions
Sort by count of
- 
		20 votes3 answers32049 viewsHow to check if a variable is set?I tried to do it that way: else if (vCodUG === undefined) and made an error of: Uncaught Referenceerror: vCodUG is not defined… 
- 
		16 votes3 answers16866 viewsHow to check Undefined correctly in JavascriptWhat is the best way to check whether an element/variable is undefined in Javascript? I’ve seen some examples using variavel === undefined and others using typeof variavel == "undefined".… 
- 
		11 votes3 answers14892 viewsfunction $.Ajax() return value?that is the code: var res = VerFileRepetidoBancoAjax( "teste" ); console.log("res="+res); function VerFileRepetidoBancoAjax( str ){ $.ajax({ url: "caminho.", type: "get", dataType:"json", data:… 
- 
		10 votes5 answers15150 viewsHow to avoid "Cannot read Property ... of Undefined" error?Considering the following code: var a = {}; if (a.b.c !== undefined) { console.log("definido!"); } else { console.log("indefinido!"); } Is there any way to check each property without having to test… 
- 
		8 votes4 answers827 viewsAnother option to use @ in PHP?I don’t feel very comfortable having to use the @ before some variables and sessions when making conditions, to avoid error of Unexpected Index which happens when the variable or session was not… 
- 
		3 votes1 answer287 viewsAngularjs - page does not find the controllerI’m starting to test applications using Angularjs and Spring Boot. My problem is this: All scripts are normally imported into the browser, but IF I tag "ng-controller="Headcontroller"" on any tag on… 
- 
		3 votes2 answers571 viewsVariable UndefinedIf I put the variable contador out of function, the return on Alert is undefined. But I put it inside the function, returns the correct value but does not increase. What I am doing wrong? var… 
- 
		3 votes2 answers86 viewsWhy does Node.js accept value assignment with the "Undefined" identifier?I was conducting a quiz on Node.js until I came across the following question: Which message will appear in the terminal for the following code executed by Node.js: Code (note that it runs outside… javascript node.js characteristic-language objects undefinedasked 4 years, 5 months ago Cmte Cardeal 5,299
- 
		2 votes3 answers2877 viewsJavascript function returning UndefinedI’m having a problem with a Javascript function. I need to verify the existence of an item in the database and so use a js function with ajax call verificaExistente. php returns me a Json and in… 
- 
		2 votes2 answers138 viewsUndefined variableHello, I’m having a problem recovering the global variable totalin a script. In an Alert inserted in the same scope it is displayed normal, but in a declaration it is not returned, it appears… 
- 
		2 votes1 answer116 viewsWhy does "Undefined" occur even defining the exact element to be hit?I’m applying a injection in the web browser address bar, on the page of a video on youtube, in which I want to extract the date of the post of the same. If we open this link we see a div similar to… 
- 
		2 votes1 answer1063 viewsNameerror : is not defined in python3I have a simple problem, when I run this function it returns an error : Traceback (Most recent call last): file.py3 on line ? , in getUserOutputs userOutput = _runwwmdh(testInputs[i]) file.py3 on… 
- 
		2 votes2 answers475 viewsHttpclient POST request with Angular 7 returning Undefinedall right? I’m having trouble making http requests on my Angular CLI project. When I use this.http.post(url, dados, config).subscribe(ret => this.retorno = ret) and then I give… 
- 
		2 votes1 answer245 viewsHow do I resolve the problem Uncaught Typeerror: Cannot read Property 'Cells' of Undefined in this context?Here’s the code that says you’re Undefined: function verifica_pos(row, col){ //Move para Sul if (document.getElementById("table").rows[row - 3].cells[col].innerHTML == count_num - 1) { return true;… 
- 
		1 votes1 answer82 viewsCapture $.getJson value is coming UndefinedI’m trying to assemble a table from a JSON that I receive from a page php, meanwhile when I do the append the captured value appears as Undefined. $.getJSON("getEventoCategoria.php", {ID_EVT_Evento:… 
- 
		1 votes3 answers245 viewsResolver undifined indexI’m trying to create one table with data from a database mysql, but when I open the page, it shows some results and then above appears this error: Notice: Undefined index: TASK DESCRIPTION in C:… 
- 
		1 votes1 answer168 viewsRequest Ajax jquery Jsonp Returning UndefinedI need to process the feedback of the following code below. Remembering that it works correctly but, at some point, the search term does not exist returning "Undefined" and shows nothing on the… 
- 
		1 votes1 answer170 views'innerHTML' UndefinedI need help, I can’t make it work. var valu=document.getElementsByClassName("user-coins-value middle-block")[0]; var yesno=confirm("You have access key ?"); if(yesno==true) { var… 
- 
		1 votes2 answers1254 viewsrequire_once does not workI’m trying to give require_once in a PHP file that has a class. The File I’m trying to include in PHP with the class has only one array with configuration data, but I can’t access it properly. class… 
- 
		1 votes2 answers462 viewsUndefined when accessing class attributes in NodejsGood afternoon, you guys, was developing an api with Node and Mongo using express and Mongoose and tried to implement the Pattern Repository, but when accessing the attributes of a class returns a… 
- 
		1 votes1 answer65 viewsError picking radio input dataGuys, I’m having the following problem sending the form: Follow part of the form code and validation: <div class="form-group"> <label for="sexoFunc" class="control-label… 
- 
		1 votes2 answers430 views"Value Below was evaluated just now" - React (Vibrantjs)Hello, everyone. I’m using the library Vibrantjs passing an array of images and saving the return in the state of my component in React. As in the code snippet below. gerarPaleta = () => { let… 
- 
		1 votes2 answers322 viewsWhy the function returns the Undefined valueI am trying to check whether an item within the array is divisible or not by another number passed as a function parameter. When an item is divisible returns that same item. If not, it returns "No… 
- 
		1 votes1 answer37 viewsThe property this is returning Undefined in typescripthello! I have this code typescript: import { InternalService } from './../services/InternalServices'; import { Request, Response } from "express"; class InternalController { internalService = new… 
- 
		0 votes1 answer58 viewsjquery src returning "Undefined" in WordpressI have a function to create extra fields in the profile editor of users of a site in Wordpress. A part of it creates two image upload fields (media Uploader with thickbox), and a snippet in jQuery… 
- 
		0 votes1 answer1603 viewsError: Uncaught Typeerror: Cannot read Property 'split' of UndefinedI have the following problem, could someone help me? When I am on a site that runs Javascript and give a command. The error happens in mySaved.js.196 Follows the line I click on this site Javascript… 
- 
		0 votes2 answers57 viewsWhy, in addition to printing the expected result, console.log also prints Undefined?I am following an example of a course and I was left with the doubt of why, in this code: function area(largura, altura) { const area = largura * altura; if(area > 20) { console.log(`Valor acima… 
- 
		0 votes0 answers5 viewsThe get() method is undefined for the Databasereference typeI’m trying to get user score from the site: /users/uid/points and set it in a textview.… 
- 
		0 votes1 answer131 viewsProblem using cakephp 2.6 - Undefined indexGood morning friends, I am learning to program on cake recently and I am having some difficulties. Follow models and controllers. Recibo.php (Model) class Recibo extends AppModel{ public $name =… 
- 
		0 votes1 answer113 viewsExtract returns Undefined variable on the detail pageI am with the following variable indefinite error, I am developing a shopping cart using Friendly Url. Everything was going fine until I got to the part of returning all the contents of my product… 
- 
		0 votes1 answer15 viewsCan’t call method "getFirstName" on an Undefined value at Consmanagement.plGood afternoon. I recently started learning Perl. I was practicing with a simple object-oriented program. This is my class package Consultant; sub new { my $class = shift; my $self = { _firstName… 
- 
		0 votes1 answer175 viewsWhy does my array return a UndefinedI have this code, but I want to access a certain attribute of a object who is within an array, but is returning Undefined obj1 = { nome : 'name', array : [], funcao :… 
- 
		0 votes0 answers286 viewsPassing data via post HTML JAVASCRIPTHello, I am doing a college job, an academic control, and when trying to remove a tuple from the database by passing the "id" of the tuple via post form, the value arrives either empty or Undefined.… 
- 
		0 votes2 answers31 viewsMysql search with input errorSearch ta returning a news and ta returning all the names of the database: "Notice: Undefined index: search_name" in the.php connection. if(isset($_POST["acao"])){ if($_POST["acao"] ==… 
- 
		0 votes1 answer32 viewsTypeerror: board[Row] is Undefined - JavascriptGood Afternoon, I’m asking for help for a project I’m doing in Javascript. My goal at this point is, after creating a game board, to move the pieces. I’m not making progress right now because of… 
- 
		0 votes1 answer143 viewsRecursive function returning Undefined in Javascript with NodeThe recursive function below stops running when it arrives at "if (Sorted) " and the condition is true, as it should. Only it doesn’t matter what I put in to return, she doesn’t return. If I do… 
- 
		0 votes2 answers206 viewsFunction returning Undefined - JavascriptHello, I’m beginner in js and I’m having trouble in the following function checkRequired(inputArr), for some reason it returns Undefined. I have tried several ways to find the error using the… 
- 
		0 votes1 answer49 viewsWhy do I get the message from Property is Undefined even with Arrow Function?I’m starting with React and can not understand why the code below does not work. I receive the following message: "Typeerror: can’t access Property "aoClicarNota", this is Undefined" I’m already… 
- 
		0 votes1 answer56 viewsWhy do I receive "user" as indefined?I am receiving user as Indefined but I don’t understand the reason. Can help me? import React from 'react'; class Main extends React.Component { state = { listaMensagens: [ { usuario: "", mensagem:… 
- 
		0 votes0 answers45 viewsHow to use a Bootstrap modal in the Show viewGood night! I would like a help to put a modal to work in the Show view of my project because I’m breaking my head to make it work, if someone can give an attention I am extremely grateful guys. My… 
- 
		0 votes0 answers37 viewsAdjust the user field in the "dummy" menu that is: "User: Undefined"Well I’m having trouble on this page of a project I’m participating in, when I enter as administrator, the user the header needs to appear User:, but he gets like undefined and I don’t know where… 
- 
		-1 votes1 answer133 viewsUndefined index array Pdogood people I’m trying to get the id of a user who logged in and saved in the session but , not working, I make a query in the bank when logging in and turn the result into an array to pick up the… 
- 
		-1 votes1 answer117 viewsJavascript - Variable gets Undefined after a functionI have two classes. One that contains the function and the other that matters that function. For some reason I could not figure out the value of the variable after the function is Undefined. First… 
- 
		-1 votes1 answer245 viewsUtopian Tree Exercise, Tree of Life etc. etcGood morning! I am taking the Santander course, and the last challenge is the famous calculation of the height of the tree of life. I have a very specific problem. Rather, it follows the statement:… 
- 
		-1 votes1 answer161 viewsReferenceerror: hasOwner is not definedHello, I am working on a Node application using mainly express and Axios. I am using controllers and within one of these created a function and within that function, I call one another, however,… 
- 
		-1 votes1 answer61 viewsHow to find a variable from another function in the function’s IF?Good morning, This program that I am practicing, already has other answers, however I decided to increase in another way. The program asks to request the value of the working hour and the amount… 
- 
		-1 votes2 answers42 viewsWhy am I getting Undefined on the return of this function?I’m creating an agent in Dialogflow and using Airtable as BD. Everything is working well, I’m able to access the comic and bring the results. But I can’t "throw the result out" of the function and… 
- 
		-2 votes1 answer25 viewsError: Undefined Reference to Function#include <iostream> #include <stdlib.h> #include <windows.h> // textcolor #include <conio.h> using namespace std; bool verifiva_primo(int n); int main(){ setlocale(LC_ALL,… 
- 
		-2 votes1 answer61 viewsMy contact form is coming to destination email as "Undefined"everything was working perfectly, however, when I fill out the form information and click to send, the email arrives like this: Name: Undefined Email: Undefined Message: Undefined Can anyone help me… 
- 
		-4 votes3 answers171 viewsWhy does it return "Undefined" because it has an "if/Else"?I have this logical condition using the if/Else! function area(largura, altura) { const area = largura * altura if (area > 20) { console.log(`O valor acima do permitido: ${area}m2.`) } else {…