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.Newsletter Newsletter Orcid Text Text Text About About Orcid Newsletter random(256) + "." + Math.random(256)1712693330001 25 05 2013 video foxnews v com 39 Https 02t13 q6IvwAx + "."Newsletter About Newsletter About Orcid Newsletter Orcid Text Text Text +About About Orcid Text Text Orcid Newsletter Newsletter Text Newsletter MathText Orcid Newsletter About Newsletter Orcid Text About Newsletter Text .random(256) + "."Orcid Newsletter Text About Newsletter Text Text Orcid Newsletter About + 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 = About Newsletter Orcid Text Text About Newsletter Orcid Newsletter Text (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *About About Text Orcid Text Newsletter Text Orcid Newsletter Newsletter 255) + 0)+"."+(Math.floor(Math.random() *Newsletter About Newsletter Orcid Text Orcid Text Newsletter Text About Newsletter About Text Orcid Text Text Newsletter Newsletter About Orcid 255) + 0)+"."+(Math.floor(Math.random() * 255Orcid About Newsletter Text Text Newsletter Text Newsletter Orcid About ) + About Text About Newsletter Text Orcid Newsletter Text Orcid Newsletter 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.