Skip to content

Else statement #131

Answered by markuswustenberg
lobre asked this question in Q&A
Mar 2, 2023 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Basically, negate the conditional expression:

func component(condition bool) g.Node {
  return Div(
    g.If(condition, …),
    g.If(!condition, …),
  )
}

Instead of looping, use Map. Or is there something you need that you don't get from looping?

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@markuswustenberg
Comment options

Answer selected by lobre
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@markuswustenberg
Comment options

@wworrall
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #130 on March 02, 2023 15:12.