Let $X$ be a quasi-category. (i.e. a simplicial set satisfying the weak Kan extension condition). Given two 'objects' $a,b\in X_0$ in $X$, one defines the mapping space $X(a,b)$ to be the pullback of $$ X^{\Delta^1}\to X^{\partial\Delta^1}\cong X\times X $$
Along the map $pt\to X\times X$ that takes the point to the pair $(a,b)$. It is (apparently) well known that $X(a,b)$ is always a Kan complex (provided $X$ is a quasi-category as we assumed). How does one prove this? I've seen this stated in several papers of Joyal, but without a proof and with references to some unfindable sources. I am sure this also appears somewhere in Lurie's HTT , but I got lost in all the different mapping space objects that he uses. An outline of the argument or a readable self contained reference would be very much appreciated.

As Zhen noted, $\newcommand{\Hom}{\mathrm{Hom}}\Hom_X(a,b)$ is an $\infty$-category and it suffices to show that every 1-morphism of $\Hom_X(a,b)$ is an equivalence. In particular it is sufficient to show that every $(2,0)$-horn $\Lambda^2_0 \to \Hom_X(a,b)$ can be filled. One can translate this to the condition that any morphism $$ \Lambda^2_0 \times \Delta^1 \bigsqcup_{\Lambda^2_0 \times \partial\Delta^1} \Delta^2 \times \partial\Delta^1 \longrightarrow X, $$ that maps $\Lambda^2_0 \times \{0\}$ to $a$, lifts to a morphism $\Delta^2 \times \Delta^1 \to X$. Since in particular the 1-simplex $d^2(\Delta^2) \times \{0\}$ is mapped to an equivalence of $X$, the claim follows from Proposition 2.4.1.8 of HTT. To see how that proposition is applied here, see the proof of Lemma 2.3.3.5, for example. It may be overkill here, though, the idea is just the same as the proof of the implication (1) => (2) in Proposition 2.1.2.6 (Joyal's characterization of left anodyne maps).