Skip to content
Advertisement

Tag: function

Unexpected token, expected , (8:21)

So I’m working with this code for a blockchain mining class And I keep getting this error Unexpected token, expected , (8:21), for this line: Any help will be appreciated! Answer Try Using this Seems to me like you key:value pairs are not properly formatted.. The code in probably taking this above line as Key and is expecting a value

Javascript – make function in object global

Let’s say I have an object obj with a function f1 that accept two parameters a and b. The function is called as follows: Now I want to make f1 accessible without calling obj as follows: Is this possible? If so, how may I achieve this? Edit: If yes, is there a way to make all functions in the object

Vuex Method-style Access Getters

I am having a bit hard time understanding the following JS: These two code snippets are taken from official Vuex Documentation on Method Style Access for Getters. Now what I dont understand is, how those the second part of code output the value in the comment? Maybe I miss-understood JS functions? I believe the output would be: So actually the

I need to write difficult palindrome

That’s my example. String are given. Implement a function – detectPalindrom, that can detect palindrome string. Given argument not an string – return ‘Passed argument is not a string’. Given string is empty – return ‘String is empty’. Given string palindrome – return ‘This string is palindrome!’. Given string is not a palindrome – return ‘This string is not a

Advertisement