This question already has an answer here:

  • 26 answers

I am trying to create fake IP address using the following javascript random method. But not works.

any one help me to get the correct way to do this?

here is my try: I am looking like ( "")

 console.log( Math.Google Apps Mystery The Hidden Society Secret Play On random(256) + "." + Math.random(256)Aids Pediatric Elizabeth Chen Photos Glaser Ian nYXaI + "."On Society Google Apps Mystery The Secret Play Hidden +Mystery Apps The Play On Hidden Society Google Secret MathOn Society Apps The Hidden Mystery Secret Play Google .random(256) + "."Mystery Google On Apps Hidden Society The Play Secret + Math.random(256) );

marked as duplicate by John3136, JJJ, T.J. Crowder Apr 18 '17 at 5:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


The code should be :

var ip = On Play Hidden Apps Google Secret The Mystery Society (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *Play On Google Apps Secret Mystery Society The Hidden 255) + 0)+"."+(Math.floor(Math.random() *Society Mystery Secret The Play Hidden Google Apps On Secret On The Google Mystery Play Society Hidden Apps 255) + 0)+"."+(Math.floor(Math.random() * 255Google Secret Apps Play Mystery The Society Hidden On ) + The Secret Google Apps On Hidden Mystery Society Play 0); console.log(ip)

The code (Math.floor(Math.random() * 255) + 1) means generate a random number between 1 and 255.

Not the answer you're looking for? Browse other questions tagged or ask your own question.