Skip to content

✨ Feature: Blog post on the difference between 'assertion' and 'cast' #144

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Feature Request Checklist

  • I have searched for related issues and found none that matched my issue.
  • This is the appropriate issue form for the feature I would like to request.

Feature

I mention in the book that common use of the two terms are different:

  • Assertion commonly means a type-system only operation: we're "asserting" that, regardless of inference, a value is a particular type
  • *Cast8 commonly means a runtime change: we're casting/coercing a value at runtime to a different value

This gets confused a lot. IMO it'd be helpful to have an article.

Additional Info

Inspired by @kirkwaiblinger's typescript-eslint/typescript-eslint#10458, thank you Kirk! 😄

💖

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions