Click here to Skip to main content
15,889,116 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Getting "Notice: Undefined offset: 1" error Pin
samflex23-Feb-17 2:59
samflex23-Feb-17 2:59 
PraiseRe: Getting "Notice: Undefined offset: 1" error Pin
Richard Deeming23-Feb-17 3:41
mveRichard Deeming23-Feb-17 3:41 
QuestionDownload images from bing to use without internet connection Pin
Member 1301427820-Feb-17 23:42
Member 1301427820-Feb-17 23:42 
AnswerRe: Download images from bing to use without internet connection Pin
OriginalGriff20-Feb-17 23:44
mveOriginalGriff20-Feb-17 23:44 
GeneralRe: Download images from bing to use without internet connection Pin
Member 1301427820-Feb-17 23:49
Member 1301427820-Feb-17 23:49 
AnswerRe: Download images from bing to use without internet connection Pin
ZurdoDev21-Feb-17 2:01
professionalZurdoDev21-Feb-17 2:01 
Questionangular-cli chrome extension bootstrap from many .html Pin
JulioGold19-Feb-17 8:29
JulioGold19-Feb-17 8:29 
Questionremoving duplicates from array in order to use regex to find match. returning null Pin
Member 1299542016-Feb-17 16:26
Member 1299542016-Feb-17 16:26 
Im using this function to go through my values that are in an array to find if they equal a small straight ("1234" or "2345" or "3456");
I decided the way id get this to work is by using regular expression , which worked if I got for example "12345". However if i got duplicates of a value , example "12234" it would not work. I used the filter function to get rid of the duplicate values, which worked however when it comes to my regular expressions it keeps returning null even when my x value returns for example "1234". Im thinking there has something to do with the filter function since without it i get values returned but I need it in order to get rid of duplicate values. console[^]

JavaScript
function smstraight(){
	var score=0;
	var x=dice_value.sort();
	    // removes duplicates
	    x=x.filter(function(item,index,inputArray){
               return x=inputArray.indexOf(item) ==index;
              
	    }).join("");
	  var r1= /\B(1234)/g;
	      var a= x.match(r1);
	  var r2=/\B(2345)/g;
	      var b= x.match(r2);
	  var r3=/\B(3456)/g;
	     var c= x.match(r3);

	    console.log(x);
	    if(b== "2345" || a== "1234"|| c=="3456" || x== "12345"||x=="23456"){
	    	console.log("hey it works");
	    		score+= 30;
		$('.sm').html(score);
	    }
	     
	
}

AnswerRe: removing duplicates from array in order to use regex to find match. returning null Pin
Nathan Minier17-Feb-17 1:31
professionalNathan Minier17-Feb-17 1:31 
QuestionAJAX request for photos Pin
Member 1300611016-Feb-17 11:06
Member 1300611016-Feb-17 11:06 
QuestionDynamically add row by DIV(SOLVED) Pin
samflex16-Feb-17 5:46
samflex16-Feb-17 5:46 
AnswerRe: Dynamically add row by DIV Pin
Richard Deeming16-Feb-17 8:40
mveRichard Deeming16-Feb-17 8:40 
GeneralRe: Dynamically add row by DIV Pin
samflex16-Feb-17 9:05
samflex16-Feb-17 9:05 
GeneralRe: Dynamically add row by DIV Pin
Richard Deeming16-Feb-17 9:30
mveRichard Deeming16-Feb-17 9:30 
GeneralRe: Dynamically add row by DIV Pin
samflex16-Feb-17 9:39
samflex16-Feb-17 9:39 
GeneralRe: Dynamically add row by DIV Pin
Richard Deeming16-Feb-17 10:12
mveRichard Deeming16-Feb-17 10:12 
GeneralRe: Dynamically add row by DIV Pin
samflex16-Feb-17 10:27
samflex16-Feb-17 10:27 
GeneralRe: Dynamically add row by DIV Pin
samflex16-Feb-17 10:52
samflex16-Feb-17 10:52 
GeneralRe: Dynamically add row by DIV Pin
Richard Deeming17-Feb-17 2:07
mveRichard Deeming17-Feb-17 2:07 
GeneralRe: Dynamically add row by DIV Pin
samflex17-Feb-17 2:53
samflex17-Feb-17 2:53 
QuestionInheriting a Javascript Prototype for Web Usercontrol Pin
HemeshSoni13-Feb-17 5:27
HemeshSoni13-Feb-17 5:27 
AnswerRe: Inheriting a Javascript Prototype for Web Usercontrol Pin
Richard Deeming13-Feb-17 8:06
mveRichard Deeming13-Feb-17 8:06 
GeneralRe: Inheriting a Javascript Prototype for Web Usercontrol Pin
HemeshSoni13-Feb-17 17:18
HemeshSoni13-Feb-17 17:18 
AnswerRe: Inheriting a Javascript Prototype for Web Usercontrol Pin
HemeshSoni13-Feb-17 17:25
HemeshSoni13-Feb-17 17:25 
Questionmvc app with angular not working in IIS on 80 port Pin
Member 1103130413-Feb-17 0:17
Member 1103130413-Feb-17 0:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.