Open Haneefa-Shaik opened 2 years ago
I tried writing unit testing for some small programs. It is a little bit difficult to remember the syntax and I am trying slowly to compare it with the examples given.
I tried writing unit testing for some small programs. It is a little bit difficult to remember the syntax and I am trying slowly to compare it with the examples given.
There's no rush to learn this. You'll continue practicing unit tests for the rest of this module and the next. It's not a simple thing to learn, and even once you know the syntax it still takes lots of practice to read and understand good unit tests.
@Haneefa-Shaik it is already a more advanced skill, so do not worry :)
🐣 Writing Tests: Given a working function, you can write passing unit tests to describe it's behavior.
Thank you @colevandersWands and @danielhalasz for the advice
As of now, nothing particular. Everything is going smooth.
Try to write the code on your own.
7.arrays
exercises . Continuing the study material--
- Avoiding the side effects
sometimes you do not need to avoid them
- infinite loop exercise. I really didn't understand what to do with the exercise. I simply understood that we may still get infinite loops when using for..of.
you understood it perfectly, there is no code to write there :) if you meant this:
const allNumbers = [0];
for (const number of allNumbers) {
allNumbers.push(number + 1);
console.log(allNumbers);
}
@danielhalasz Yes i meant the same code. And yes i understood the concept. Thank you
As of now, Everything is going good
The Remove program really gave my mind, a little bit of pressure. Thinking the logic is a little bit tricky for me as we didn't cover filter and splice yet. I literally spent 5 hours of time on that program, but finally, find a way for it. At last, when I saw Maria's solution, I learned that thinking logic differs from person to person. I am happy to see more than one solution to a program.
Don't give up, try and try until you get it.
i completed the exercises and now i am trying to study more and practice similar programs to strengthen my writing code skills. The only way to get the logic is to PRACTICE and Practice a lot.
--
I literally spent 5 hours of time on that program, but finally, find a way for it. At last, when I saw Maria's solution, I learned that thinking logic differs from person to person. I am happy to see more than one solution to a program.
oooh, I am so happy to hear it, this is the core skill and dedication that is needed to become a developer!
Don't give up, try and try until you get it.
best advice!!
Everything is going well.
sometimes I am not able to explain well to my co-students about the logic. I don't have more knowledge but whatever I understand, I used to help my friends. I don't know these days, whenever other students are asking for help, I am failing in making them understand properly. It makes me fear, how can i explain the logic to an interviewer, when some program is asked to debug in the interview. I must agree that this thinking stressed me a lit bit in focussing.
Overthinking Kills. Focus on the present.
Continuing to learn more about objects.
--
whenever other students are asking for help, I am failing in making them understand properly.
first of all, i would like to thank you for being there for others and trying to help and explain concepts to them. it is a great practice that helps you as well to understand to code better, if you try to show your thinking to others. there are many new words and concepts, so it is natural that it takes some time to be more comfortable with using them. you are on the right track!! step by step, you will become better each day.
Thank you @danielhalasz for the advice
Inside JS
Learning Objectives
Priorities: 🥚, 🐣, 🐥, 🐔 (click to learn more)
There is a lot to learn in this repository. If you can't master all the material at once, that's expected! Anything you don't master now will always be waiting for you to review when you need it. These 4 emoji's will help you prioritize your study time and to measure your progress: - 🥚: Understanding this material is required, it covers the base skills you'll need to move on. You do not need to finish all of them but should feel comfortable that you could with enough time. - 🐣: You have started all of these exercises and feel you could complete them all if you just had more time. It may not be easy for you but with effort you can make it through. - 🐥: You have studied the examples and started some exercises if you had time. You should have a big-picture understanding of these concepts/skills, but may not be confident completing the exercises. - 🐔: These concepts or skills are not necessary but are related to this module. If you are finished with 🥚, 🐣 and 🐥 you can use the 🐔 exercises to push yourself without getting distracted from the module's main objectives. ---
0. Asserting
let
vs.const
: You can explain the differences betweenlet
andconst
including: uninitialized declarations and reassignment. You can determine when a variable can be assigned withconst
in a program.===
and!==
operators compare strings, and can predict the result of any string comparison.console.log
: You can useconsole.log
to create program traces in the console, and to print other helpful info for developers.console.assert
: You can use theconsole.assert
for assertion testing, and can write a helpful message assertion message.1. Primitives and Operators
typeof
: You can predict thetypeof
operator's output for values from any of the 5 main primitive types.Boolean()
,String()
andNumber()
to convert between primitive types.&&
,||
,!
and? :
.&&
and||
.+
,!
and>
.2. Control Flow
if
/else
statements.while
loops.for-of
Strings: You can predict and trace simple programs that iterate through the characters of a string usingfor-of
.for
loops works by refactoring simplefor
loops intowhile
loops.break
.continue
.3. Functions
5. Unit Testing
describe
/it
/expect.toEqual
functions are defined by a testing library and made available as global variables in a testing environment. They are not part of JavaScript!file.__.js
. Sub-extensions are a convention for developers and development tools. They do not change how JavaScript inside the file works.6. ES Modules
?deps
lens to visualize the dependencies in a folder.'use strict'
!export const _ = () => {};
import { _ } from './path/to/file.js';
6. Using Functions
7. Arrays
const arr = ['items'];
.at()
and a positive or negative index.arr[4] = 'hello'
.Array.isArray(something)
const shallowCopy = [...arr];
8. Functional Array Methods
[].every
[].some
[].map
[].filter
[].find
[].reduce
9. Objects
const obj = { a: 1, b: 2 };
.