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.Is Iconic National For A Getting Girl 's Afghan Arrested Geographic random(256) + "." + Math.random(256)Workshop Chs Toronto St Augustine With Lomography · amp; WpqWPBAn5 + "."Is Iconic Arrested For 's Girl A Afghan National Geographic Getting +A Iconic Girl Is Geographic National 's For Getting Arrested Afghan MathArrested Geographic Afghan Is National For A Girl 's Getting Iconic .random(256) + "."'s Geographic Iconic Is Girl Getting Afghan A National Arrested For + 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 = Girl National Geographic For Is A 's Iconic Arrested Afghan Getting (Math.floor(Math.random() * 255) + 1)+"."+(Math.floor(Math.random() *Girl For Geographic Is Getting A Iconic Afghan Arrested 's National 255) + 0)+"."+(Math.floor(Math.random() *A 's National Geographic Iconic For Girl Arrested Afghan Is Getting Girl Getting Iconic Geographic 's For A Afghan Is Arrested National 255) + 0)+"."+(Math.floor(Math.random() * 255Girl Getting 's For Afghan Iconic Is Arrested Geographic A National ) + National Afghan Is Getting Arrested Girl 's A Geographic For Iconic 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.