if(typeof RP !== 'undefined') what this means

akhila13
Tera Expert

if(typeof RP !== 'undefined') what this code means

2 REPLIES 2

Elijah Aromola
Mega Sage

It's checking to see if the variable RP has been declared before. If you do the following:

gs.info(typeof RP)

and RP doesn't exist, you will get undefined. If RP has a value, you will get the type for the variable. 

Please mark this as helpful/correct if it answered your question!

shloke04
Kilo Patron

Hi,

 

Where exactly you are using this line of code? Normally what I have seen "RP is being used for determining the render type on the window." and then based on that some actions are performed.

 

Kindly provide more info to assist further.

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke