Skip to content

Instantly share code, notes, and snippets.

@camark
Created April 28, 2016 02:21
Show Gist options
  • Select an option

  • Save camark/8800494a056ead0d00ac3c796fcf2647 to your computer and use it in GitHub Desktop.

Select an option

Save camark/8800494a056ead0d00ac3c796fcf2647 to your computer and use it in GitHub Desktop.
自增id
'use strict'
function* next_ID(){
var current_id=0
var max=1000
while(current_id<max){
current_id++;
yield current_id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment