Jump to content

Need help with Simple javascript..

Guest
Go to solution Solved by WereCatf,
3 minutes ago, Nolanrulesroblox said:

So, I need to detect if item (object) is not found.

if(typeof(somevariablehere) == "undefined") console.log("somevariablehere is undefined.")

 

So, I need to detect if item (object) is not found. 

 

<script>
item {
inwingwnig: "ojwfowjof",
inwingwnig: "ojwfowjof",
inwingwnig: "ojwfowjof",
inwingwnig: "ojwfowjof",
inwingwnig: "ojwfowjof"
// blah blah blah
}

if (item not found) {
console.log("error");
}

 

I have tried using:

    if (typeof item ==(=) undefined) {
        console.log("error")
    }
    
    // the (=) meaning i tried both
    // and
    
        if (item == undefined) {
        console.log("error")
    }
    
    // i also tried null

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Nolanrulesroblox said:

So, I need to detect if item (object) is not found.

if(typeof(somevariablehere) == "undefined") console.log("somevariablehere is undefined.")

 

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

perfect!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×