Below is the text that I currently have:
LOG: time="2021-12-09T16:55:25+01:00" level=debug msg="🎁 GetLatestBlock called" blockHeight=3 blockID=ee98016d268630db54b814d18d0127edac8cc36f90d193c0c6f5fd4909bbd8b1
,LOG: time="2021-12-09T16:55:25+01:00" level=debug msg="👤 GetAccountAtLatestBlock called" address=f8d6e0586b0a20c7
,LOG: time="2021-12-09T16:55:26+01:00" level=debug msg="️✉️ Transaction submitted" txID=5a46897e60f13ee68e11ef754983fefe9ec7bc8a2ca6079f0665e404138735e9
,LOG: time="2021-12-09T16:55:26+01:00" level=info msg="⭐ Transaction executed" computationUsed=6 txID=5a46897e60f13ee68e11ef754983fefe9ec7bc8a2ca6079f0665e404138735e9
,LOG: time="2021-12-09T16:55:26+01:00" level=debug msg="\x1b[1;34mLOG\x1b[0m \x1b[2m[5a4689]\x1b[0m \"Hello from Emulator\"""
time="2021-12-09T16:55:26+01:00" level=debug msg="\x1b[1;34mLOG\x1b[0m \x1b[2m[5a4689]\x1b[0m 0x1cf0e2f2f715450"
time="2021-12-09T16:55:26+01:00" level=debug msg="\x1b[1;34mLOG\x1b[0m \x1b[2m[5a4689]\x1b[0m 0x179b6b1cb6755e31"
time="2021-12-09T16:55:26+01:00" level=debug msg="📦 Block #4 committed" blockHeight=4 blockID=5fd780a98baad6d30f66cf75e76c3e1c9398097a9bb2e3f239f0cd7e166f6932
,LOG: time="2021-12-09T16:55:26+01:00" level=debug msg="📝 GetTransactionResult called" txID=5a46897e60f13ee68e11ef754983fefe9ec7bc8a2ca6079f0665e404138735e9
The above content is saved in a variable named transactionLogs
. When I output this variable using console.log(transactionLogs)
, it appears as a string.
I aim to verify if the transaction logs contain two specific addresses. One belonging to Alice with ID 0x01cf0e2f2f715450
and another one for Bob with ID 0x179b6b1cb6755e31
.
The issue arises when I utilize the includes
method like this (assuming Alice
and Bob
are both strings):
Alice; // 0x01cf0e2f2f715450
Bob; // 0x179b6b1cb6755e31
transactionLogs.includes(Alice); // false
transactionLogs.includes(Bob); // true
Surprisingly, searching for Alice returns false
. I suspect it has something to do with escaped backslashes, hence I tried running
transactionLogs.replace(String.fromCharCode(92), '')
but it did not alter the outcome.
What is causing this behavior? Why does includes
fail to return true
for Alice?