LBRY Block Explorer

LBRY Claims • 12-test-if-an-array-contains-an-item

42fa40290abc3d62d53c720b9233a680c4956492

Published By
Created On
25 Jun 2021 17:21:27 UTC
Transaction ID
Cost
Safe for Work
Free
Yes
12 - Test if an Array Contains an Item - Quality Assurance with Chai - freeCodeCamp Tutorial
The include() and notInclude() methods are really useful. They can be used to check if an array contains a particular element, or to query an object. The first argument is the item we are looking in, and the second argument is the value we are looking for.

Link to Challenge : https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item
Written Guide: https://www.notion.so/ganeshh123/Test-if-an-Array-Contains-an-Item-598a08c48dbc452b9c909d04f08e6c0d

Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1SVteCORbgwlxJkAbcTiZyj
All Writen Guides for this course : https://www.notion.so/ganeshh123/54ecbf7833414db885eec37f580599b4
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26

0:00 - Concepts:
0:07 - assert.include()
Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array, a substring in a string, or a subset of properties in an object. Strict equality (===) is used. When asserting the inclusion of a value in an array, the array is searched for an element that’s strictly equal to the given value. When asserting a subset of properties in an object, the object is searched for the given property keys, checking that each one is present and strictly equal to the given property value.
https://www.chaijs.com/api/assert/#method_include
02:14 - assert.notInclude()
Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array, a substring in a string, or a subset of properties in an object. Strict equality (===) is used. When asserting the absence of a value in an array, the array is searched to confirm the absence of an element that’s strictly equal to the given value. When asserting a subset of properties in an object, the object is searched to confirm that at least one of the given property keys is either not present or not strictly equal to the given property value.
https://www.chaijs.com/api/assert/#method_notinclude
03:35 - Challenge Solution
-————————————————————————————————————-
Chai is an assertion library, similar to Node's built-in assert. It makes testing much easier by giving you lots of assertions you can run against your code.

freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they
...
https://www.youtube.com/watch?v=FdpIiPLcDOU
Author
Content Type
Unspecified
video/mp4
Language
English
Open in LBRY

More from the publisher

Controlling
VIDEO
001 -
Controlling
VIDEO
3 - G
Controlling
VIDEO
SIMPL
Controlling
VIDEO
SIMPL
Controlling
VIDEO
18 -
Controlling
VIDEO
14 -
Controlling
VIDEO
07 -
Controlling
VIDEO
7 - A
Controlling
VIDEO
04 -