DEV Community

mmvergara
mmvergara

Posted on • Edited on

3 2

Javascript Tagalog - Break Statement

Ano ngaba ang Break Statement sa Javascript?
Yung break na keyword ginagamit siya sa mga loops,switch para ma skip ang execution... something like that

Sa tingin ko yung best way para ma-understand niyo yung break statement ay to show it to you nalang


Break Statement sa while loop (also works on for loops ofcourse)

Without Break
Javascript Tagalog - Break Statement

With Break
Javascript Tagalog - Break Statement

Naterminate yung execution kasi na execute yung break sa block ng if condition therefore 1,2,3,4 nalang yung na console.log.


one thing to note that if yung while loop ay nasa loob ng function tapos may "Break" sa loob ng while loop. Yung effect ng Break non ay enclosed lang sa while loop and di pwedeng maapektuhan yung execution ng function

Javascript Tagalog - Break Statement


Break on switch statement
Javascript Tagalog - Break Statement
Break sa switch statement na kapag na fullfill na yung case e-execute nayung codeblock, in this case it is `console.log('x is 2') then break na in return be break na yung switch statement


More tagalog Javascript Learning Resources:
https://javascript-methods-in-tagalog.vercel.app/

Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay