senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:17:08 JST なちかアラート なちかアラート

    こういうコード見かけるたびに?になる

    if (....) {
    return true
    } else {
    return false
    }

    In conversation Friday, 25-Jan-2019 15:17:08 JST from oransns.com permalink
    • てるぴっぴ likes this.
    • inux39, あいじす?自鯖 and 4/30 21:00 JST: self-destruct and 4 others repeated this.
    • なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:20:25 JST なちかアラート なちかアラート
      in reply to

      あっ ここです。

      https://stackoverflow.com/questions/48515023/display-different-vuejs-components-for-mobile-browsers

      In conversation Friday, 25-Jan-2019 15:20:25 JST permalink
    • なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:28:28 JST なちかアラート なちかアラート
      in reply to

      JSで
      if ( ... ) { return true } else { return false } って書きたくなる理由は、

      `return a | b | c;` って書いたときに どこかでtrue相当の値が返るか、 null が返るからだと思うけど、
      booleanの型だけに統一したい場合は !!( a | b | c )
      って書くのが良いよね!!!!(謎

      In conversation Friday, 25-Jan-2019 15:28:28 JST permalink
      らりお・ザ・何らかの?然㊌ソムリエ repeated this.
    • なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:30:43 JST なちかアラート なちかアラート
      in reply to

      でも最近は `Boolean(a | b | c)` って書くのがモダンな気がしている・・・・・。

      In conversation Friday, 25-Jan-2019 15:30:43 JST permalink
    • なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:31:29 JST なちかアラート なちかアラート
      in reply to

      でも最近は `Boolean(a || b || c)` って書くのがモダンな気がしている・・・・・。そして | と || 間違えた。

      In conversation Friday, 25-Jan-2019 15:31:29 JST permalink
    • :nonke:​差別的なドメイン名​:homoo: (204504byse@homoo.social@homoo.social)'s status on Friday, 25-Jan-2019 15:38:55 JST :nonke:​差別的なドメイン名​:homoo: :nonke:​差別的なドメイン名​:homoo:
      in reply to

      @nacika 条件式がbool型の変数を返すというのはなんだか知らない人が多いようです。
      さらにひどいと
      bool ret = false;
      if(なんか){ret = true;}
      return ret;
      のようになります。即値をreturnできることを知らないか、あるいはreturnを複数書いていいことを知らないと。

      In conversation Friday, 25-Jan-2019 15:38:55 JST permalink
    • なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:42:12 JST なちかアラート なちかアラート
      in reply to
      • :nonke:​差別的なドメイン名​:homoo:

      @204504bySE 関数型書いてたりすると早期returnも?となるw
      簡単なようで難しいw

      In conversation Friday, 25-Jan-2019 15:42:12 JST permalink
    • なちかアラート (nacika@oransns.com@oransns.com)'s status on Friday, 25-Jan-2019 15:43:39 JST なちかアラート なちかアラート
      in reply to

      ハッシュタグつけとこ #ネットで見かけた不思議なコード

      In conversation Friday, 25-Jan-2019 15:43:39 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.