Click here to Skip to main content
15,890,440 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: If it's not one thing, it's another... Pin
Michael Martin25-May-16 20:53
professionalMichael Martin25-May-16 20:53 
GeneralRe: If it's not one thing, it's another... Pin
Nagy Vilmos25-May-16 23:32
professionalNagy Vilmos25-May-16 23:32 
JokeRe: If it's not one thing, it's another... Pin
phil.o25-May-16 22:17
professionalphil.o25-May-16 22:17 
GeneralRe: If it's not one thing, it's another... Pin
Brisingr Aerowing26-May-16 6:47
professionalBrisingr Aerowing26-May-16 6:47 
GeneralRe: If it's not one thing, it's another... Pin
#realJSOP26-May-16 1:23
mve#realJSOP26-May-16 1:23 
QuestionCoding puzzle Pin
virang_2125-May-16 13:32
virang_2125-May-16 13:32 
GeneralRe: Coding puzzle Pin
PIEBALDconsult25-May-16 13:56
mvePIEBALDconsult25-May-16 13:56 
AnswerRe: Coding puzzle Pin
ImHere2Learn25-May-16 18:49
professionalImHere2Learn25-May-16 18:49 
I'm learning ES6:
JavaScript
function* consec(array) {
	let arr = array.splice(0);
	
	while (arr.length > 0) {
		let nextSeqIndex = arr.findIndex((v, i, a) => v != a[0] + i);
		
		if (nextSeqIndex === -1) return yield arr;
		
		yield arr.splice(0, nextSeqIndex);
	}
}

let array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 22];

for (let sub of consec(array)) {
	console.log(sub);
}


code@repl.it[^]
AnswerRe: Coding puzzle Pin
Staffan Bruun25-May-16 19:48
professionalStaffan Bruun25-May-16 19:48 
AnswerRe: Coding puzzle Pin
Staffan Bruun25-May-16 20:31
professionalStaffan Bruun25-May-16 20:31 
GeneralRe: Coding puzzle Pin
Mycroft Holmes25-May-16 22:11
professionalMycroft Holmes25-May-16 22:11 
GeneralRe: Coding puzzle Pin
Staffan Bruun25-May-16 22:33
professionalStaffan Bruun25-May-16 22:33 
AnswerRe: Coding puzzle Pin
Kenneth Haugland25-May-16 21:45
mvaKenneth Haugland25-May-16 21:45 
AnswerRe: Coding puzzle Pin
Anthony Mushrow25-May-16 23:14
professionalAnthony Mushrow25-May-16 23:14 
GeneralRe: Coding puzzle Pin
virang_2126-May-16 13:01
virang_2126-May-16 13:01 
AnswerRe: Coding puzzle Pin
BillWoodruff25-May-16 23:48
professionalBillWoodruff25-May-16 23:48 
GeneralRe: Coding puzzle Pin
virang_2126-May-16 12:59
virang_2126-May-16 12:59 
AnswerRe: Coding puzzle Pin
Eytukan26-May-16 0:23
Eytukan26-May-16 0:23 
JokeRe: Coding puzzle Pin
Staffan Bruun26-May-16 3:10
professionalStaffan Bruun26-May-16 3:10 
AnswerRe: Coding puzzle Pin
PIEBALDconsult26-May-16 17:29
mvePIEBALDconsult26-May-16 17:29 
GeneralSalesForce Pin
Marc Clifton25-May-16 12:56
mvaMarc Clifton25-May-16 12:56 
GeneralRe: SalesForce Pin
Mark_Wallace25-May-16 13:16
Mark_Wallace25-May-16 13:16 
GeneralRe: SalesForce Pin
Marc Clifton25-May-16 13:23
mvaMarc Clifton25-May-16 13:23 
GeneralRe: SalesForce Pin
Mycroft Holmes25-May-16 14:25
professionalMycroft Holmes25-May-16 14:25 
GeneralRe: SalesForce Pin
Slacker00726-May-16 2:08
professionalSlacker00726-May-16 2:08 

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.