<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>panda_noir</author_name>
  <author_url>https://blog.hatena.ne.jp/panda_noir/</author_url>
  <blog_title>Panda Noir</blog_title>
  <blog_url>https://www.pandanoir.info/</blog_url>
  <categories>
    <anon>TypeScript</anon>
  </categories>
  <description>結論 const a = [1, 2, 3, null]; // nullとundefinedをはじく const filtered = a.filter(&lt;T&gt;(n: T): n is NonNullable&lt;T&gt; =&gt; n != null); // nullだけはじく const filtered2 = a.filter(&lt;T&gt;(n: T): n is Exclude&lt;T, null&gt; =&gt; n !== null); nullを除いた配列の型 nullを許容する配列があったとします。この配列にfilterをかけてnullをはじくコードは以下のようになります。 const a = [1, 2…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.pandanoir.info%2Fentry%2F2020%2F06%2F14%2F120000&quot; title=&quot;TypeScriptで配列からnullを取り除く - Panda Noir&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-06-14 12:00:00</published>
  <title>TypeScriptで配列からnullを取り除く</title>
  <type>rich</type>
  <url>https://www.pandanoir.info/entry/2020/06/14/120000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
