Page 69 - Nodejs 교과서 개정2판
P. 69

(async	()	=>	{
           		for	await	(promise	of	[promise1,	promise2])	{
           				console.log(promise);
           		}
           })();




         for	await	ofޙਸ ࢎਊ೧ࢲ ೐۽޷झ ߓৌਸ ࣽഥೞח ݽणੑפ׮  async ೣࣻ੄ ߈ജч਷ ೦࢚ Promise۽ х
         ऱ૘פ׮  ٮۄࢲ प೯ റ thenਸ ࠢ੉Ѣա ژ ׮ܲ async ೣࣻ উীࢲ awaitਸ ࠢৈࢲ ୊ܻೡ ࣻ ੓णפ׮




           async	function	findAndSaveUser(Users)	{
           		//	생략
           }
           findAndSaveUser().then(()	=>	{	/*	생략	*/	});
           //	또는
           async	function	other()	{
           		const	result	=	await	findAndSaveUser();
           }




         খਵ۽ ઺୏غח ௒ߔ ೣࣻо ੓׮ݶ ೐۽޷झܳ Ѣ୛ async await ޙߨਵ۽ ߄Բח োणਸ ೧ࠁӡ ߄ۉפ׮

         ௏٘о ഻ঁ рѾ೧૕ Ѫੑפ׮  ੉ ଼੄ ৘ઁח async await ޙߨਸ ੸ӓ੸ਵ۽ ࢎਊೞ޲۽ ੊ࣼ೧૑ח Ѫ੉
         જणפ׮


         ੉৻ীب ݆਷ ޙߨ੉ ୶оغ঻णפ׮  ೞ૑݅ ੉ ଼ীࢲח ਤীࢲ ࢸݺೠ ղਊ ੿ب݅ ੗઱ ࢎਊ೤פ׮  ׮ܲ
         ߸҃ ࢎ೦੉ ؊ ҾӘೠ ة੗ٜਸ ਤ೧    ੺ী ࢜۽਍ ޙߨਸ ߓ਎ ࣻ ੓ח ࢎ੉౟੄ ݂௼ܳ ੸য֬ওणפ׮


         ੉ઁ ೐۠౟ূ٘ীࢲ ࢎਊغח ੗߄झ௼݀౟ ௏٘ܳ ঌইࠁѷणפ׮
   64   65   66   67   68   69   70   71   72   73   74